Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it reasonable to have index on DELETED()?
Message
From
22/03/1999 10:55:33
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00196021
Message ID:
00200477
Views:
18
>then call the Time To Run Query = t, and
>let's say x% of the records are deleted.

>With indexing on deleted, performance will improve by:

>Time To Run Query = .01 * (100-x) * t

Simular rules also should apply to normal indexed fields for example:
If a table contains a sex field where the value could be "M" or "F" this field can be compared with the deleted() mark of a record.

IOW the optimizer makes no distiction between the deleted mark or a regular field. Therefor following queries should be the same:

SET DELETE ON
SELECT * FROM Table INTO CURSOR x NOFILTER

AND

SET DELETE OFF
SELECT * FROM Table WHERE DELETED() INTO CURSOR x NOFILTER

It takes not much imagination to see that this would be a simular query to:

SELECT * FROM Table WHERE Sex="M" INTO CURSOR x NOFILTER

where a index exists on Sex


Regards,

Walter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform