Overview
Besides B-tree index, because Altibase supports partitioned table, Partitioned index is supported as well.
ALTIBASE HDB does not support Indexes listed below.(based on ALTIBASE HDB V6)
- Bitmap index.
- Function-based index.
- Reversed index.
- Clustered index.
- Global partitioned index.
- IndexType
CREATE INDEX
As described previously, Altibase table comprises memory table and disk table. And Altibase Index constitutes memory table index and disk table index. Respectively, memory table index and disk table index are mapped to memory and disk table.
A message below indicates that memory/disk/volatile tablespace should be placed on the same position.(Memory->Memory, Disk->Disk)
[ERR-311EC : The type(memory/disk/volatile) of tablespace to create the index on is not same with the one of the table.]
Comparison of functionality
ORACLE |
ALTIBASE HDB |
Comments |
---|---|---|
CLUSTERED INDEX |
|
|
GLOBAL PARTITIONED INDEX |
. |
|
LOGGING|NOLOGGING |
LOGGING|NOLOGGING(FORCE|NOFORCE) |
|
PCTFREE, PCTUSED, INITRANS, MAXTRANS |
INITRANS, MAXTRANS |
|
COMPRESS|NOCOMPRESS |
|
|
INDEXTYPE IS [INDEXTYPE NAME] |
INDEX TYPE IS [BTREE|RTREE] |
ALTIBASE HDB supports Btree by default. |
SORT|NOSORT |
|
Specify NOSORT to indicate to the database that the rows are already stored in the database in ascending order, so that ORACLE Database does not have to sort the rows when creating the index. |
REVERSE |
|
Specify REVERSE to store the bytes of the index block in reverse order, excluding the rowid. |
ONLINE |
|
Specify ONLINE to indicate that DML operations on the table will be allowed during creation of the index. |
EXAMPLE
ORACLE |
ALTIBASE HDB |
---|---|
CREATE UNIQUE INDEX emp_idx2 |
CREATE UNIQUE INDEX emp_idx2 |
ALTER INDEX
This statement is used to rebuild or change an existing index.
Comparison of functionality
ORACLE |
ALTIBASE |
Comments |
---|---|---|
ENABLE|DISABLE |
|
ALTIBASE HDB provides "ALL INDEX ENABLE|DISABLE |
UNUSABLE |
|
|
COALESCE |
|
|
MONITORING|NOMONITORING USAGE |
|
|
UPDATE BLOCK REFERENCES |
|
|
DEALLOCATE UNUSED |
|
|
ALLOCATE EXTENT |
|
|
SHRINK SPACE(COMPACT CASCADE) |
|
|
PCTFREE, PCTUSED, INITRANS |
|
|
REBUILD (PARTITION|SUBPARTITION, |
REBUILD PARTITION |
ALTIBASE HDB only supports REBUILD PARTITION clause. |
COMPUTE STATISTICS |
|
In ALTIBASE HDB, rebuilding statistics can be executed using "alter index .. aging" statement. |
ONLINE |
|
|
COMPRESS|NOCOMPRESS |
|
|
RENAME TO |
RENAME TO |
|
|
AGING |
This is used to record a transaction commit SCN in an index page and delete old versions of nodes. |
|
SET PERSISTENT = ON|OFF |
To change a non-persistent index into a persistent index. and vice versa. |
EXAMPLE
ORACLE |
ALTIBASE HDB |
Comments |
---|---|---|
ALTER INDEX IDX1 REBUILD PARTITION IDX_P5 TABLESPACE TBS1; |
ALTER INDEX IDX1 REBUILD PARTITION IDX_P5 TABLESPACE TBS1; |
|
ALTER INDEX emp_idx1 RENAME TO emp_idx2; |
ALTER INDEX emp_idx1 RENAME TO emp_idx2; |
|
ALTER INDEX ord_customer_ix REBUILD REVERSE; |
ALTER INDEX ord_customer_ix REBUILD; |
|
ALTER INDEX ord_customer_ix REBUILD PARALLEL; |
ALTER INDEX ord_customer_ix REBUILD; |
|
DROP INDEX
"DROP INDEX" STATEMENT is almost same in ALTIBASE HDB and ORACLE.
But, the single difference between them is the use of "FORCE" keyword.
It is useful in Oracle for domain indexes.
This clause drops the domain index even if the indextype routine invocation returns an error or the index is marked IN PROGRESS.
EXAMPLE
ORACLE |
ALTIBASE |
---|---|
DROP INDEX ord_customer_ix_demo FORCE; |
DROP INDEX ord_customer_id_demo; |