Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Two index types can be created in the Machbase log table. 

For more information, refer to the DDL page CREATE INDEX section of the SQL Reference  .

  • LSM BITMAP Index: The LSM bitmap index can be created in all columns every column except Text and , Binary typestype.
  • KEYWORD Index: Used to search strings as it can be generated only for Varchar and Text column.

Index


Table of Contents
maxLevel3
indent30px
exclude목차
classtoc


Create Index


Create an index on a specific column using the CREATE INDEX statement.

Code Block
languagesql
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
languagesql
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
languagesql
ALTER INDEX index_name SET KEY_COMPRESS = { 0 | 1 }


Code Block
languagesql
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
languagesql
DROP INDEX index_name;


Code Block
languagesql
Mach> DROP INDEX id_index;
Dropped successfully.