Search order

Queries are more efficient when the query searches the most restricting field first. The most restricting field is the one that returns the fewest results. For example, suppose you create a query that searches for operators who work at the company Advantage (company="Advantage") and whose contact name starts with the letter A (contact.name#A). If there are more people who work at the company Advantage than whose names starts with the letter A, then the starts with query (contact.name#A) is the more restricting query. In this case, the following query is the most efficient:

contact.name#A and company="Advantage"

If you do not know your data well or you expect it to change frequently, you may instead want to order your query by how the fields are listed in table's DBDICT record. For example, in the contacts table, contact.name is the first field listed. Queries against the contact.name field are more likely to be efficient than fields listed later in the DBDICT record.

Your database administrator should regularly review the sm.alert.log for messages about inefficient queries. You may want to rewrite or remove any inefficient queries.