5.1 Regular Index | |
This is a btree index, used for '=', '>', 'MATCHES' etc. Basically everything except LIKE queries. It is used to provide rapid access to a single or range of records in the database. Btree indexes have an inherent ordering to the data, as specified in the CREATE INDEX statement.
A btree index can be created on any datatype in Texis, and can include multiple fields. The only limitation is the amount of data that can be stored for each record. You should generally keep the amount of data being indexed to a maximum of a few hundred bytes. When creating an index on multiple fields you should use the same principles that have already been mentioned of putting the most selective fields first, or the most used if you will have lots of different queries. An index will only be used if the first field in the index is also in the query. If so then the other fields in the index will also be evaluated.
Btree indexes can also be designated as UNIQUE. If that is done then records that have identical field contents in the indexed fields will be rejected, and the INSERT or UPDATE will fail. This can be used to ensure that duplicate records are not inserted.
Back: Indexing | Next: Metamorph Index |