Create Index
Create an index on a specific column using the CREATE INDEX statement.
Code Block | ||
---|---|---|
| ||
CREATE INDEX index_name ON table_name (column_name) [index_type] [tablespace] [index_prop_list] index_type ::= INDEX_TYPE { LSM | KEYWORD } tablespace ::= TABLESPACE tablesapce_name index_prop_list ::= value_pair, value_pair, ... value_pair ::= property_name = property_value |
Code Block | ||
---|---|---|
| ||
Mach> CREATE INDEX id_index ON log_data(id) INDEX_TYPE LSM TABLESPACE tbs_data MAX_LEVEL=3; Created successfully. |
Change Index
Change the index attribute using the ALTER INDEX statement.
Code Block | ||
---|---|---|
| ||
ALTER INDEX index_name SET KEY_COMPRESS = { 0 | 1 } |
Code Block | ||
---|---|---|
| ||
Mach> ALTER INDEX id_index SET KEY_COMPRESS = 1; |
Delete Index
Delete the specified index using the DROP INDEX statement. However, if there is another session in which the table is being searched, it will fail with an error.
Code Block | ||
---|---|---|
| ||
DROP INDEX index_name; |
Code Block | ||
---|---|---|
| ||
Mach> DROP INDEX id_index; Dropped successfully. |