You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ch...@apache.org on 2012/06/28 22:51:46 UTC

svn commit: r1355154 - /db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita

Author: chaase3
Date: Thu Jun 28 20:51:45 2012
New Revision: 1355154

URL: http://svn.apache.org/viewvc?rev=1355154&view=rev
Log:
DERBY-5822  Document the new SQL standard behavior of the SPACE_TABLE vti

Merged DERBY-5822.diff to 10.8 docs branch from trunk revision 1355117.

Modified:
    db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita

Modified: db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita?rev=1355154&r1=1355153&r2=1355154&view=diff
==============================================================================
--- db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita (original)
+++ db/derby/docs/branches/10.8/src/ref/rrefsyscsdiagtables.dita Thu Jun 28 20:51:45 2012
@@ -181,10 +181,18 @@ to determine if space might be saved by 
 <p>All users can access this diagnostic table function, whether or not the
 database has authentication and SQL authorization enabled.</p>
 <p>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 <parmname>schemaName</parmname> and the <parmname>tableName</parmname>.
-The <parmname>tableName</parmname> argument is required. If you do not specify
-the <parmname>schemaName</parmname>, the current schema is used. </p>
+the SQL table function syntax. You can invoke the table function in the
+following ways:
+<ul>
+<li>If invoked with no arguments, the table function retrieves
+space information for all tables and indexes in the database.</li>
+<li>If invoked with one argument, a <parmname>tableName</parmname>, the table
+function retrieves information for the specified table in the current
+schema.</li>
+<li>If invoked with two arguments, a <parmname>schemaName</parmname> followed by
+a <parmname>tableName</parmname>, the table function retrieves information for
+the specified schema and table.</li>
+</ul></p>
 <p>The returned table has the columns shown in the following table.</p>
 <table frame="all">
 <title>Columns returned by the SYSCS_DIAG.SPACE_TABLE function</title>
@@ -253,16 +261,25 @@ the <parmname>schemaName</parmname>, the
 <entry colname="4">false</entry>
 <entry colname="5">The estimated space which could possibly be saved by compressing the conglomerate, in bytes.</entry>
 </row>
+<row>
+<entry colname="1">TABLEID</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">false</entry>
+<entry colname="5">The id of the table to which the conglomerate belongs. </entry>
+</row>
 </tbody>
 </tgroup>
 </table>
-<p>For
-example, use the following query to return the space usage for all of the
-user tables and indexes in the database: <codeblock>SELECT T2.*
-    FROM 
+<p>For example, use the following query to return the space usage for all of the
+user tables and indexes in the database:
+<codeblock>SELECT T2.*
+    FROM
         SYS.SYSTABLES systabs,
-        TABLE (SYSCS_DIAG.SPACE_TABLE(systabs.tablename)) AS T2
-    WHERE systabs.tabletype = 'T'</codeblock>where T2 is a user-specified
+        TABLE (SYSCS_DIAG.SPACE_TABLE()) AS T2
+    WHERE systabs.tabletype = 'T'
+    AND systabs.tableid = T2.tableid;</codeblock>
+where T2 is a user-specified
 table name that is any valid identifier. </p><p>Both the <parmname>schemaName</parmname> and
 the <parmname>tableName</parmname> arguments must be expressions whose data
 types map to Java strings. If the <parmname>schemaName</parmname> and the <parmname>tableName</parmname> are