Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2409196FD for ; Thu, 28 Jun 2012 19:15:24 +0000 (UTC) Received: (qmail 58776 invoked by uid 500); 28 Jun 2012 19:15:24 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 58752 invoked by uid 500); 28 Jun 2012 19:15:24 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 58745 invoked by uid 99); 28 Jun 2012 19:15:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 19:15:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 19:15:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1BAB8238890B; Thu, 28 Jun 2012 19:15:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1355117 - /db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita Date: Thu, 28 Jun 2012 19:14:59 -0000 To: derby-commits@db.apache.org From: chaase3@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120628191500.1BAB8238890B@eris.apache.org> Author: chaase3 Date: Thu Jun 28 19:14:59 2012 New Revision: 1355117 URL: http://svn.apache.org/viewvc?rev=1355117&view=rev Log: DERBY-5822 Document the new SQL standard behavior of the SPACE_TABLE vti Updated src/ref/rrefsyscsdiagtables.dita. Modified: db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita Modified: db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita?rev=1355117&r1=1355116&r2=1355117&view=diff ============================================================================== --- db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita (original) +++ db/derby/docs/trunk/src/ref/rrefsyscsdiagtables.dita Thu Jun 28 19:14:59 2012 @@ -182,10 +182,18 @@ to determine if space might be saved by

All users can access this diagnostic table function, whether or not the database has authentication and SQL authorization enabled.

To access the SYSCS_DIAG.SPACE_TABLE diagnostic table function, you must use -the SQL table function syntax. This diagnostic table function takes two arguments, -the schemaName and the tableName. -The tableName argument is required. If you do not specify -the schemaName, the current schema is used.

+the SQL table function syntax. You can invoke the table function in the +following ways: +
    +
  • If invoked with no arguments, the table function retrieves +space information for all tables and indexes in the database.
  • +
  • If invoked with one argument, a tableName, the table +function retrieves information for the specified table in the current +schema.
  • +
  • If invoked with two arguments, a schemaName followed by +a tableName, the table function retrieves information for +the specified schema and table.
  • +

The returned table has the columns shown in the following table.

Columns returned by the SYSCS_DIAG.SPACE_TABLE function @@ -254,16 +262,25 @@ the schemaName, the falseThe estimated space which could possibly be saved by compressing the conglomerate, in bytes. + +TABLEID +CHAR +36 +false +The id of the table to which the conglomerate belongs. +
-

For -example, use the following query to return the space usage for all of the -user tables and indexes in the database: SELECT T2.* - FROM +

For example, use the following query to return the space usage for all of the +user tables and indexes in the database: +SELECT T2.* + FROM SYS.SYSTABLES systabs, - TABLE (SYSCS_DIAG.SPACE_TABLE(systabs.tablename)) AS T2 - WHERE systabs.tabletype = 'T'where T2 is a user-specified + TABLE (SYSCS_DIAG.SPACE_TABLE()) AS T2 + WHERE systabs.tabletype = 'T' + AND systabs.tableid = T2.tableid; +where T2 is a user-specified table name that is any valid identifier.

Both the schemaName and the tableName arguments must be expressions whose data types map to Java strings. If the schemaName and the tableName are