Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help to Speed up SQL
Message
De
09/03/2002 07:58:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/03/2002 23:15:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00629818
Message ID:
00630559
Vues:
29
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform