Open topic with navigation

TIBCO ActiveSpaces® - Enterprise Edition 5.0.0

# Creating an Index

Use the SQL command CREATE INDEX to create a secondary index for a table in the data grid.

Procedure
1. Compose a string with the following format:

       CREATE INDEX [ IF NOT EXISTS ] <index_name> ON <table_name> (
                    <column_name> [, <column_name>]...)
                    [ <property_name>=<property_value>
                    [, <property_name>=<property_value>]... ]

2. Pass the string to the `ExecuteUpdate` method of the `tibdgSession` object.

   For example:

       CREATE INDEX index1 ON table1 (col1, col5)
       CREATE INDEX IF NOT EXISTS index2 ON table1 (col1, col5, col7)
       CREATE INDEX index3 ON table1 (col2, col3) row_counts=exact

   Note the following points when using the CREATE INDEX command:

   - Only columns with data types that map to ActiveSpaces long and string data types can be secondary index columns. For more information, see SQL Data Type Mapping.
   - Escaped names are supported.
     Note: In SQL, an escaped name is a sequence of one or more characters enclosed within SQL escape characters. Trailing spaces are insignificant.

     Special characters used within the escaped name must themselves be escaped.

   - Object names (for example <column_name>, <index_name>, and <table_name>) are case insensitive.
   - ActiveSpaces converts all object names to lowercase before running the command.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveSpaces® - Enterprise Edition

Copyright © 2009-2025. Cloud Software Group, Inc. All Rights Reserved.