Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very Slow SQL , Why?
Message
 
À
31/07/1998 00:02:28
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:
00123028
Vues:
16
>Hi Jim,
>
>It is nice to know that the select should respect the condition of the set key even though I can tell perhaps you prefered it did not.
> snip>
>I have an index on UPPER(REGION).
>I have also used where region = "NORTH" and ... and ... etc...
>But it takes several minutes to query, should this be the case.(P200MMX 64RAM)
>I do not have an index on deleted() and set deleted is off.
>I am selecing into a temp table that has no indexes. I could build one each time the select statement is run. This is a bit slow, creating an index on or reindexing the temp table, don't you think? then theres the last performance hit when I finally brow the temptable.
>
>TIA Again!!!

Rick,

If I missaid something I am sorry, SELECT does NOT respect set filter or set key and shoudl not. You specify your filter within the SELECT command. You should have an index of deleted whether you have deleted records or not. With the index tag you mentioned your select should be;

SELECT * FROM TableName WHERE UPPER(Region) = "NORTH" ...

since the index tag expression has UPPER(Region) your where clause must be an exact match so it need to be UPPER(Region) as well.

Make sure there is amatching index tag for every item in the WHERE list that it is possible to have one for. So if you are;


SELECT * ;
FROM TableName ;
WHERE UPPER(Region) = "NORTH" ;
AND UPPER(City) = "NEW YORK" ;
AND UPPER(CustCode) = "A" ;
AND Balance > 1000 ...

Make sure there are index tags on UPPER(City), UPPER(CustCode) and Balance. That will insure that Rushmore will optimized the query.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform