Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very Slow SQL , Why?
Message
De
30/07/1998 22:47:56
 
 
À
30/07/1998 22:39:06
Rick Clarke
Fotobae Pty. Ltd.
Adelaide, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00122940
Message ID:
00122941
Vues:
16
>Why is it so slow, I chose Fox because everyone raves of its database speed. I must be way of here! Can you help me to select from this table based on 2 conditions. first is to narrow the 120,000 rec's down to blocks of approx. 40,000 by one filter condition e.g Region = "NORTH" then perform a where filter condition to further narrow this selection. TIA


1. Make sure you have an index on each item in the where clause, the same as you specify it in the where clause.

2. If you have SET DELETED ON... create an index on deleted()

3. SET ORDER TO

4. Don't use filters, use a select...

select fields from file1,file2 where region = 'NORTH' and etc...

So.. with the above you should have an index on upper(region)

Also, there is a sys command to see if your select is fully optimized...

Also, depending on what you are doing, sometimes it is faster to SEEK to the first record you want, then do a scan on the rest of the file to do what you nee... like...

seek 'NORTH'
scan rest while region = 'NORTH'

do whatever

endscan

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform