KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: What does it mean when 4D is doing a sequential search on a table?
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: October 25, 2018

There are two types of queries that 4D does: Indexed and Sequential.

Indexed queries are optimized and are faster than sequential searches because they utilize an index to quickly lookup the value.

Sequential queries are not optimized and are slower because they check each record sequentially instead of using an index.

If 4D reports that it is performing a sequential search when you try to query on a table, this is an indication that the query is not optimized.

To optimize the query, an index should be added for the field that is being queried upon.

For example, if the following query ends up being a sequential search:

QUERY([Table_1];[Table_1]Field_1=1)

The solution is to add an index to the field that is being queried upon ([Table_1]Field_1).

Further analysis of the execution times can be conducted using the following commands:
* DESCRIBE QUERY EXECUTION
* Get last query path
* Get last query plan


TL/DR:
Sequential Search = Not Optimized
Indexed Query = Optimized

See Also: