Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
>Walter-
>
>>Ehhh, I'm afraid I can't follow that. Why should I need an INDEX on deleted() if I filter my PKs on DELETED() ?
>
>Er, actually the PK index filter is on !deleted() right?
ehh, yes.
>And the deleted() tag is useful when you have SET DELETED ON. Sometimes. *sigh*
You're right. In the following circumstance it might help (of course when SET DELETE = ON):
- If you want to fully optimize the COUNT() command.
- If you have significant amounts of deleted() records in the table, it might speed up queries returning large portions of the table, however queries that return only smal portions of the table and can be optimized enough by a more discriminating (selective) key (like a PK) may suffer from the deleted() tag.
- You want to use the feature that VFP creates filters if a SQL-select command is fully optimizable. However, this feature seems not to have much applications. Not seldom are people bitten by this feature as they are not able to index a cursor returned from the SQL - SELECT command.
Since these applications are fairly rare, I think the general rule should be, DON'T use an index tag on DELETED(), unless you've got very, very good reason to and accept the performance penalties that come with the use of it.
Sidenote: If you use the DELETED() tag to search for deleted records to recycle them, you might be better of to use an INDEX ON .t. FOR DELETED() TAG delrec and a SEEK(.t.,"yourtable","DelRec")
Walter,
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement