>If an app uses Views for all it's data entry - is there any improvement of performance when the Base tables are indexed on DELETED()?
>
>Thanks
>Kev
As Cindy said, there may be a performance boost if a large percentage of your records are deleted. If so, then VFP can use the tag to optimize the query. If not and you had DELETED set ON, VFP would use the deleted tag to optimize that filter condition and slow your query down because the intermediate result set wouild contain too many candidate records. Look at what is going on.
If you have DELETED ON, VFP uses the DELETED() tag to optimize the following query:
select * from mytable where not deleted()
Bit string representation of above query
00000000001000000000000000010000000000000001
Your real query looks like this:
select * from mytable where name='F'
Bit string representation of above query
10000000110000011000000000000000000000000000
VFP downloads all index nodes for both queries, builds the bit representation and then uses BITAND on it to get the final results.
10000000110000011000000000000000000000000000
The added overhead of downloading the index nodes for the deleted tag and then bit it against the index nodes from the Name tag is not needed. This is a small example and the time differential would be neglible but if you extrapolate this too very large data sets, you could run into some serious performance problems.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao