Advantage TDataSet Descendant
When determining the record count, indicates whether to respect the filtering applied to the dataset. Filtering consists of all applicable filters, ranges, and scopes.
type TAdsRespectFilters = ( IGNORE_WHEN_COUNTING, RESPECT_WHEN_COUNTING );
property AdsTableOptions.AdsFilterOptions;
This setting affects whether filters, ranges, and scopes are respected or ignored using the following methods: AdsGetKeyCount, AdsGetKeyNum, AdsGetRecordCount, and AdsGetRecordNum. In addition, this setting affects whether filters are respected or ignored using the following methods: AdsCopyTable, AdsCopyTableContents.
When using RESPECT_WHEN_COUNTING, this function will skip through every or many records in a table and could be extremely slow depending on how many records pass the filter, range, and scope. It is not recommended to use this function except on very small tables.
When using IGNORE_WHEN_COUNTING with AdsCopyTable, AdsCopyTableContents, AdsGetRecordCount, and AdsGetRecordNum, the operations will occur much faster than if using RESPECT_WHEN_COUNTING. When using IGNORE_WHEN_COUNTING with AdsGetKeyCount and AdsGetKeyNum, these operations may still be quite slow with large indexes because every or many keys in the index are literally counted.