Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help to Speed up SQL
Message
From
09/03/2002 07:58:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
08/03/2002 23:15:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00629818
Message ID:
00630559
Views:
28
Bill,

Looking back at your original message, I assume that the slowness may be caused by using HAVING instead of WHERE: Since there is no WHERE clause, there is nothing to optimize here! All records are fetched! Perhaps this explains why you didn't get a noticable speed difference with, and without, the deleted() index.

VFP works in this sequence:

1) Fetch records that meet the criteria for the WHERE clause. Use R.O. where aplicable. (If there is no WHERE clause, all records will be fetched here!).

2) Group records with the GROUP BY clause.

3) Apply a filter to the combined records, with the HAVING clause.

Perhaps you can re-arrange your query, so that you filter out records first. That is, apply a WHERE clause.

HTH, Hilmar.
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform