Command SET SMARTFILTER Foundation

Enables/Disables smart filtering.

Syntax
SET SMARTFILTER ON | off | <lToggle>
Scope
thread-local, current work space
Parameters
<lToggle>
<lToggle> is a logical expression which must appear in parentheses. Instead of the logical expression, the option ON can be specified for the value .T. (true) or OFF for the value .F. (false). The default setting is ON.
Description

Smart Filtering is an incremental optimization technology that can boost the speed of database navigation dramatically when a filter condition is set in a work area. This is especially useful when data is browsed using TBrowse(), XbpBrowse() and XbpQuickBrowse(). Normally, a filter expression must be evaluated each time the record pointer is moved in a work area, i.e. data must be read to check whether or not a record matches the filter condition. With SET SMARTFILTER ON, the filter expression is evaluated only once for each record that is accessed and does not match the filter expression at that point in time. All records not matching the filter condition are excluded from subsequent database navigation requests since Smart Filtering keeps track of those records. This way, repeated and unnecessary read-access of non-matching records is avoided. For all matching records, the filter condition is evaluated again each time the record is accessed.

The function DbRefresh() forces Smart Filtering to reset its internal "non-matching-record" buffer. This allows for synchronization in networking environments or multithreaded scenarions.

More details about the different optimization technologies and their dependencies can be found at SET RUSHMORE.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.