class CreateIndexConstantAction extends IndexConstantAction
Modifier and Type | Field and Description |
---|---|
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 |
indexName, schemaName, tableName
tableId
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
getIndexName, setIndexName
dropConglomerate, dropConglomerate, dropConstraint, dropConstraint, dropConstraint, executeConglomReplacement, getConglomReplacementAction, recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges
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
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)
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 indextrue
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 errorApache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.