Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DELETED() Index
Message
 
 
À
25/01/2001 07:17:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00468366
Message ID:
00468499
Vues:
13
>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 exact same if no deleted tag were used
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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform