The R:BASE index is similar to an index in a book; both indexes allow you to find information faster. Instead of searching through a book page by page, you can look up the topic in the index and find the exact page number of the topic. Similarly, you can apply indexes to columns so that R:BASE finds data faster.

When you apply an index to a column, R:BASE records the location of every value in that column. Then, when you look for or sort information in the column, R:BASE uses the index to find the rows you need quickly. For example, you want to list the bonuses that employee 102 earned; if the empid column in the salesbonus table is indexed, R:BASE finds and searches that column faster. Indexes are most useful when you have tables with many rows.

Note:
Indexes are stored in the .RB3 file.

You can apply the following types of indexes:
 
·Unique index - Ensures that the values entered in the indexed column are unique  

·Full or partial text index - For columns with NOTE or TEXT data types. R:BASE preserves each character in the indexed column (a full text index). Or, you can specify the number of characters to preserve, and R:BASE hashes (converts characters to a 4-byte integer) the remaining characters (a partial index).  

To keep the .RB3 file from becoming too large, use a partial index--specify enough characters to guarantee the values are unique. If the preserved values are not unique, R:BASE must unhash the values before it can identify the rows, which slows performance. If you do not specify the number of characters to preserve, R:BASE preserves all of them, unless there are more than 200 characters defined; then, R:BASE preserves the first 32 and hashes the rest.  

·Multi-column index - A combination of up to 8 columns in one index. For example, if you consistently search three columns when working with a certain database, you can define a separate index for each column. Or, you can define one index for all three columns--R:BASE searches a multi-column index faster than three separate indexes.  
 

Primary, unique, and foreign key columns are indexed automatically. In addition, the following types of columns are good for indexing:

·Columns that are neither primary nor foreign keys, but are frequently referred to in queries and sorts.  
·Columns that have rules applied to them--in most cases, R:BASE can use indexing to check rules faster.  
·Linking columns in views.  


Valid names must start with a letter, and can include the following characters:

·Letters (A-Z)  
·Numbers (0-9)  
·# (pound sign)  
·_ (underscore)  
·$ (dollar sign)  
·% (percent sign)  


See also
CREATE INDEX Command  
DROP command