Information générale
Catégorie:
Codage, syntaxe et commandes
Without the BINARY modifier 2 valued indeces are more a hindrance than a speed up.
With BINARY the size of the index is so much smaller that the index helps more tha it costs.
Instead of 4 byte intergers for Recno() a single bit at bitoffset (Recno()) is used - huge save in space, resulting in much faster handling.
But I ***always*** have to check Rushmore optimization, as some functions are not used in Rushmore
So I often use the literal when building the index and writing the filter expression
Age creeps up on me....
>I see the example they use is on DELETED() which I have not used. Not sure how much difference it would make in our tables if all these tags were changed to binary. I also know there have been some comments over time that having a "IsDeleted" index tag is not worth it (I guess depending on how many records are deleted vs. not) - because it is just about as fast to go to the actual table for data if only say, 1 percent of the records are deleted vs. vfp looking at the deleted index.
>
>>Not only .t./.f.: if I find fields with 1..4 values, combining 2 binary indices like IsOdd and IsLow can give you better perf if used often in filtering, as only 1 bit per record (the resulting Rushmore "map") is persisted and combined in filtering, reducing index size like crazy.
>>
>>>But all a good discussion - I have never used a binary index and so had to look it up. Might come in handy some day if there is a true/false answer on a field expression.
>>>Thanks!
>>>
>>>>You read my mind via my not well formulated question perfectly!
>>>>Binary Index should speed up that particular subquery, but if empty(partfile.Date_Closd ) is not used elsewhere in table filtering operations, your current approach probably is best, as overindexing produces its own pain points.
>>>>
>>>>regards
>>>>thomas
>>>>
>>>>>It is non-nullable. Have a machine index, not binary. The index is used in other ad-hoc queries where the users can specify a closing date range. Binary would just be for indexing if empty or not correct (at least that is what I am guessing you are getting at).
>>>>>
>>>>>Albert
>>>>>
>>>>>>Hmmm, seems to big a win - did you have a BINARY INDEX on partfile.Date_Closd ?
>>>>>>(guessing that this is non-nullable)
>>>>>>
>>>>>>>Made the changes and that indeed worked better and faster.
Précédent
Suivant
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