This is an old revision of the document!
Criteria is usually optimized by creating indexes on each column involved in the WHERE clause of a SQL statement. This is true regardless of the use of Boolean operators or parentheses. Normally, these will be installed with basic Omnidex indexes; however, some columns may contain textual data and would benefit from QuickText indexes.
The following examples show how to evaluate queries and choose the Omnidex indexes. Below the examples is an Omnidex Environment File that will generate these indexes.
In the following statement, look for the columns used as criteria in the WHERE clause
select NAME, ADDRESS1, ADDRESS2, PHONE
from INDIVIDUALS
where ((STATE = 'CO' and CITY = 'Boulder') or
(STATE = 'IL' and CITY = 'Chicago'))
The STATE and CITY columns should be Omnidex indexes.
In this example, you might want to use QuickText indexes.
select NAME, ADDRESS1, ADDRESS2, PHONE from INDIVIDUALS where STATE = 'CO' and NAME = 'John'
The STATE column should be an Omnidex index and the NAME column should be a Quicktext index.
In this same example, we might want to allow case insensitivity.
select NAME, ADDRESS1, ADDRESS2, PHONE from INDIVIDUALS where STATE = 'co' and NAME = 'john'
The STATE column should be an Omnidex index with the Case Insensitive option, and the NAME column should be a QuickText index. QuickText indexes are automatically case insensitive.
See also: