3.11 Performance Considerations

Now that you have defined your query, you should check the points which may improve its performance.

For example:

Are there any virtual fields that you don't need in your query?

If there are, remove them from your list by moving them out of the Selected Fields area.

Have you added any conditions to a virtual field?

If you have, could you use a key field or data field for this condition instead?

Is your sorting criteria only attached to key fields?

If not, could you change the sorting criteria to sort on key fields and still obtain the data in the sequence you require?

Have you attached field selection conditions to the secondary file of your query?

Your query will run faster if you select from fields in your primary file, rather than your secondary file. If you must select conditions in your secondary file, you might consider re-organizing your query to switch the files.

For example, imagine that you want to retrieve Sales for a specific Region. You could have defined the Sales file as your primary file and the Sales Area file, which contains the Sales Area descriptions, as your secondary file. If your Sales file contains the Sales Area Code and your Sales Area file contained the Region Codes, then your query would run faster if your Sales Area file was the primary file.

You may also find that your query runs faster if you use the smaller file as your primary file.

Is the value you have entered in the same case as the data you are selecting?

Selecting data which exactly matches the Value you have entered will help your query run faster. If you are not sure of the case (upper or lower) of the data that you are looking for, run your query to retrieve a limited number of records to see what is retrieved. This may enable you to change the Value to match that of the data. To limit the number of records retrieved by your query, select the Output Options command in the Query menu.