Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it reasonable to have index on DELETED()?
Message
De
21/03/1999 09:09:10
 
 
À
21/03/1999 03:53:13
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00196021
Message ID:
00200260
Vues:
23
>Bela,
>
>>I guess we try to get to know a black box. I question is, How smart fox is to optimize? If Deleted is the first that fox is check (and result set in percent is high), the Deleted tag is usefull, but if deleted status check is the last step, (and result set is low in percent) deleted tag has very low impact on performance.
>If someone of creators of fox would answer to this thread, we could be sure about it. Is not it?
>
>No it's not. The optimizer makes use of the indexes by loading the index information first and determine the optimizable resultset. Only after this it will load the actual records to apply the non-optimizable filter.
>
>If there are not too many deleted records within this resultset there would be no benefit to the deleted() tag as the resultset without the deleted tag would be simular in size as the with the deleted tag. So from a Rushmore point of view there is no need for a index on deleted().
>
>The are some circumstances where an index would benefit the performance:
>
>- When you have SET DELETED on AND want to make use of the filter capability of the SQL SELECT statement
>- You have lots of deleted records in your table (or tables), lets say more than 5 - 10%
>
>Maybe the optimizer can optimize the following
>
>- You want to COUNT records with SET DELETED ON (as the optimizer doesn't have to count the actual records but only the index key's)
>
>As these circumstances should be fairly rare (as you don't have to maintain lots of deleted records in large tables) you would generally NOT need any index on deleted()
>
>PS. I did not try to check this on a black box manner. I did only want to describe how the optimizer uses indexes to optimize query's in theory.
>
>Regards,
>
>Walter

Hi Walter!

Thanks for your reply. I agree with you. But there is a point I donnot understand.
what do you mean on:

"When you have SET DELETED on AND want to make use of the filter capability of the SQL SELECT statement"
What type of filter capacity?
I usually SET DELETED ON, and make many SQL SELECT with complex WHERE clauses. Only one of my tables contains deleted records. Should I make tag on deleted() in all table?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform