|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.vti.VTITemplate
org.apache.derby.diag.SpaceTable
public class SpaceTable
SpaceTable is a virtual table that shows the space usage of a particular table and its indexes. This virtual table can be invoked by calling it directly, and supplying the schema name and table name as arguments.
SELECT * FROM TABLE(SYSCS_DIAG.SPACE_TABLE('MYSCHEMA', 'MYTABLE')) T;
If the schema name is not supplied, the default schema is used.
SELECT * FROM TABLE(SYSCS_DIAG.SPACE_TABLE('MYTABLE')) T;
NOTE: Both the schema name and the table name must be any expression that evaluates to a string data type. If you created a schema or table name as a non-delimited identifier, you must present their names in all upper case.
The SpaceTable virtual table can be used to estimate whether space might be saved by compressing a table and its indexes.
The SpaceTable virtual table has the following columns:
To get space information on all schemas and tables, use a query such as
select v.*
from SYS.SYSSCHEMAS s,
SYS.SYSTABLES t,
TABLE(SYSCS_DIAG.SPACE_TABLE(SCHEMANAME, TABLENAME)) v
where s.SCHEMAID = t.SCHEMAID;
| Field Summary | |
|---|---|
private static ResultColumnDescriptor[] |
columnInfo
|
private ConglomInfo[] |
conglomTable
|
(package private) int |
currentRow
|
(package private) boolean |
initialized
|
private static java.sql.ResultSetMetaData |
metadata
|
private java.lang.String |
schemaName
|
private SpaceInfo |
spaceInfo
|
private java.lang.String |
tableName
|
private TransactionController |
tc
|
private boolean |
wasNull
|
| Fields inherited from interface org.apache.derby.vti.VTICosting |
|---|
defaultEstimatedCost, defaultEstimatedRowCount |
| Fields inherited from interface java.sql.ResultSet |
|---|
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
| Constructor Summary | |
|---|---|
SpaceTable(java.lang.String tableName)
|
|
SpaceTable(java.lang.String schemaName,
java.lang.String tableName)
|
|
| Method Summary | |
|---|---|
void |
close()
|
private void |
getConglomInfo(LanguageConnectionContext lcc)
|
double |
getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment)
Get the estimated cost for a single instantiation of a Table Function. |
double |
getEstimatedRowCount(VTIEnvironment vtiEnvironment)
Get the estimated row count for a single scan of a Table Function. |
int |
getInt(int columnNumber)
|
long |
getLong(int columnNumber)
|
java.sql.ResultSetMetaData |
getMetaData()
|
short |
getShort(int columnNumber)
|
private void |
getSpaceInfo(int index)
|
java.lang.String |
getString(int columnNumber)
|
boolean |
next()
|
boolean |
supportsMultipleInstantiations(VTIEnvironment vtiEnvironment)
Find out if the ResultSet of the Table Function can be instantiated multiple times. |
boolean |
wasNull()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ConglomInfo[] conglomTable
boolean initialized
int currentRow
private boolean wasNull
private java.lang.String schemaName
private java.lang.String tableName
private SpaceInfo spaceInfo
private TransactionController tc
private static final ResultColumnDescriptor[] columnInfo
private static final java.sql.ResultSetMetaData metadata
| Constructor Detail |
|---|
public SpaceTable(java.lang.String schemaName,
java.lang.String tableName)
public SpaceTable(java.lang.String tableName)
| Method Detail |
|---|
private void getConglomInfo(LanguageConnectionContext lcc)
throws StandardException
StandardException
private void getSpaceInfo(int index)
throws StandardException
StandardExceptionpublic java.sql.ResultSetMetaData getMetaData()
getMetaData in interface java.sql.ResultSetResultSet.getMetaData()
public boolean next()
throws java.sql.SQLException
next in interface java.sql.ResultSetjava.sql.SQLException - if no transaction context can be foundResultSet.next()public void close()
close in interface java.sql.ResultSetResultSet.close()public java.lang.String getString(int columnNumber)
getString in interface java.sql.ResultSetgetString in class VTITemplateResultSet.getString(int)public long getLong(int columnNumber)
getLong in interface java.sql.ResultSetgetLong in class VTITemplateResultSet.getLong(int)public short getShort(int columnNumber)
getShort in interface java.sql.ResultSetgetShort in class VTITemplateResultSet.getShort(int)public int getInt(int columnNumber)
getInt in interface java.sql.ResultSetgetInt in class VTITemplateResultSet.getInt(int)public boolean wasNull()
wasNull in interface java.sql.ResultSetwasNull in class VTITemplateResultSet.wasNull()public double getEstimatedRowCount(VTIEnvironment vtiEnvironment)
VTICosting
getEstimatedRowCount in interface VTICostingvtiEnvironment - The state variable for optimizing the Table Function.
VTICosting.getEstimatedRowCount(org.apache.derby.vti.VTIEnvironment)public double getEstimatedCostPerInstantiation(VTIEnvironment vtiEnvironment)
VTICosting
getEstimatedCostPerInstantiation in interface VTICostingvtiEnvironment - The state variable for optimizing the Table Function.
VTICosting.getEstimatedCostPerInstantiation(org.apache.derby.vti.VTIEnvironment)public boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment)
VTICosting
supportsMultipleInstantiations in interface VTICostingvtiEnvironment - The state variable for optimizing the Table Function.
VTICosting.supportsMultipleInstantiations(org.apache.derby.vti.VTIEnvironment)
|
Built on Sat 2009-11-21 18:44:10-0800, from revision 883030 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||