|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.execute.DDLConstantAction
org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
org.apache.derby.impl.sql.execute.IndexConstantAction
org.apache.derby.impl.sql.execute.CreateIndexConstantAction
class CreateIndexConstantAction
ConstantAction to create an index either through a CREATE INDEX statement or as a backing index to a constraint.
| Field Summary | |
|---|---|
private java.lang.String[] |
columnNames
|
private UUID |
conglomerateUUID
|
private long |
conglomId
Conglomerate number for the conglomerate created by this constant action; -1L if this constant action has not been executed. |
private long |
droppedConglomNum
Conglomerate number of the physical conglomerate that we will "replace" using this constant action. |
private boolean |
forCreateTable
Is this for a CREATE TABLE, i.e. it is for a constraint declared in a CREATE TABLE statement that requires a backing index. |
private ExecRow |
indexTemplateRow
|
private java.lang.String |
indexType
|
private boolean[] |
isAscending
|
private boolean |
isConstraint
|
private java.util.Properties |
properties
|
private boolean |
unique
|
private boolean |
uniqueWithDuplicateNulls
|
| Fields inherited from class org.apache.derby.impl.sql.execute.IndexConstantAction |
|---|
indexName, schemaName, tableName |
| Fields inherited from class org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction |
|---|
tableId |
| Constructor Summary | |
|---|---|
CreateIndexConstantAction(boolean forCreateTable,
boolean unique,
boolean uniqueWithDuplicateNulls,
java.lang.String indexType,
java.lang.String schemaName,
java.lang.String indexName,
java.lang.String tableName,
UUID tableId,
java.lang.String[] columnNames,
boolean[] isAscending,
boolean isConstraint,
UUID conglomerateUUID,
java.util.Properties properties)
Make the ConstantAction to create an index. |
|
CreateIndexConstantAction(ConglomerateDescriptor srcCD,
TableDescriptor td,
java.util.Properties properties)
Make a ConstantAction that creates a new physical conglomerate based on index information stored in the received descriptors. |
|
| Method Summary | |
|---|---|
private boolean |
addStatistics(DataDictionary dd,
IndexRowGenerator irg,
long numRows)
Determines if a statistics entry is to be added for the index. |
void |
executeConstantAction(Activation activation)
This is the guts of the Execution-time logic for creating an index. |
(package private) long |
getCreatedConglomNumber()
Get the conglomerate number for the conglomerate that was created by this constant action. |
(package private) UUID |
getCreatedUUID()
Get the UUID for the conglomerate descriptor that was created (or re-used) by this constant action. |
(package private) ExecRow |
getIndexTemplateRow()
|
(package private) long |
getReplacedConglomNumber()
If the purpose of this constant action was to "replace" a dropped physical conglomerate, then this method returns the conglomerate number of the dropped conglomerate. |
private RowLocationRetRowSource |
loadSorter(ExecRow[] baseRows,
ExecIndexRow[] indexRows,
TransactionController tc,
GroupFetchScanController scan,
long sortId,
RowLocation[] rl)
Scan the base conglomerate and insert the keys into a sorter, returning a rowSource on the sorter. |
java.lang.String |
toString()
|
| Methods inherited from class org.apache.derby.impl.sql.execute.IndexConstantAction |
|---|
getIndexName, setIndexName |
| Methods inherited from class org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction |
|---|
dropConglomerate, dropConglomerate, dropConstraint, dropConstraint, dropConstraint, executeConglomReplacement, getConglomReplacementAction, recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull |
| Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction |
|---|
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final boolean forCreateTable
private boolean unique
private boolean uniqueWithDuplicateNulls
private java.lang.String indexType
private java.lang.String[] columnNames
private boolean[] isAscending
private boolean isConstraint
private UUID conglomerateUUID
private java.util.Properties properties
private ExecRow indexTemplateRow
private long conglomId
private long droppedConglomNum
| Constructor Detail |
|---|
CreateIndexConstantAction(boolean forCreateTable,
boolean unique,
boolean uniqueWithDuplicateNulls,
java.lang.String indexType,
java.lang.String schemaName,
java.lang.String indexName,
java.lang.String tableName,
UUID tableId,
java.lang.String[] columnNames,
boolean[] isAscending,
boolean isConstraint,
UUID conglomerateUUID,
java.util.Properties properties)
forCreateTable - Being executed within a CREATE TABLE
statementunique - True means it will be a unique indexuniqueWithDuplicateNulls - True means index check and disallow
any duplicate key if key has no
column with a null value. If any
column in the key has a null value,
no checking is done and insert will
always succeed.indexType - type of index (BTREE, for example)schemaName - schema that table (and index)
lives in.indexName - Name of the indextableName - Name of table the index will be ontableId - UUID of tablecolumnNames - Names of the columns in the index,
in orderisAscending - Array of booleans telling asc/desc
on each columnisConstraint - TRUE if index is backing up a
constraint, else FALSEconglomerateUUID - ID of conglomerateproperties - The optional properties list
associated with the index.
CreateIndexConstantAction(ConglomerateDescriptor srcCD,
TableDescriptor td,
java.util.Properties properties)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Object
public void executeConstantAction(Activation activation)
throws StandardException
A index is represented as:
activation - The execution environment for this constant action.
StandardException - Thrown on failureConglomerateDescriptor,
SchemaDescriptor,
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)
private boolean addStatistics(DataDictionary dd,
IndexRowGenerator irg,
long numRows)
throws StandardException
As an optimization, it may be better to not write a statistics entry to SYS.SYSSTATISTICS. If it isn't needed by Derby as part of query optimization there is no reason to spend resources keeping the statistics up to date.
dd - the data dictionaryirg - the index row generatornumRows - the number of rows in the index
true if statistics should be written to
SYS.SYSSTATISTICS, false otherwise.
StandardException - if accessing the data dictionary failsExecRow getIndexTemplateRow()
long getCreatedConglomNumber()
long getReplacedConglomNumber()
UUID getCreatedUUID()
private RowLocationRetRowSource loadSorter(ExecRow[] baseRows,
ExecIndexRow[] indexRows,
TransactionController tc,
GroupFetchScanController scan,
long sortId,
RowLocation[] rl)
throws StandardException
StandardException - thrown on error
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||