>Hi Friends !
>
>I created a Binary Index on DELETED() using the VP9 and used the commands:
>
> SET OPTIMIZE ON
> SET DELETED OFF
> LOCATE FOR DELETED()
>
> to locate the first deleted register. I noticed that same using binary indexes the traffic in the network continues very big after the command LOCATE above.
>
>My table has just 16000 registers and 5000 are deleted(33% deleted).
>
>I think the SELECTIVITY RATIO is very bad one or I am making something wrong.
>
>Everything what i desire is to use the recycling of registers, in other words, the registers are marked as deleted and when necessary I use the command LOCATE E RECALL to recover them without the need of using APPEND BLANK and avoiding PACK in a multisuer environment.
>
>Does anybody have some suggestion?
>
>Thanks in advance,
>
>[]´s
>
>Dionísio
"Register" is "record" in English.
First, I would suggest that you forget about recycling records; it is far easier to do a PACK once a month.
If you insist, consider the following.
Any command to locate records will use the index on deleted() (if you have SET DELETED ON), since a clause like:
select * from Cliente where CodCliente = "ABC"
will be interpreted by VFP as:
select * from Cliente where CodCliente = "ABC" and not deleted()
You can force Visual FoxPro NOT to use this index, by using a different expression, for example:
index on deleted() and .T.
In the above example, since the search expression doesn't match the index expression, the index on
deleted() and .T. will not be used, and the search should be much faster.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)