KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Optimizing QUERY SELECTION With a Small Current Selection
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: July 28, 2000

Sometimes, performing a QUERY SELECTION in a small current selection could be much slower then performing a sequential query. This is true if the current number of records for the table is very large.

You can detect this case with a function that calculates the ratio of selected records to all records, and perform a QUERY SELECTION BY FORMULA, which will force 4D to perform a sequential query.

You can also use the SET DATABASE PARAMETER command and the Seq Query Select Ratio constant (5) to specify a new value. In this case, you could still use the QUERY SELECTION command and 4D will switch automatically the kind of query for you.