Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing query on table using GENERAL index
Message
De
20/02/2008 10:40:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/02/2008 10:38:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01294254
Message ID:
01294256
Vues:
22
>Hi all,
>
>I have just finished implementing GENERAL indexes on a client's data so that they get "culturally correct sorting". For their client's table, I changed a few of the indexes from:
>
>INDEX ON UPPER(Lastname) TAG Lastname
>
>to the new and improved:
>
>INDEX ON Lastname TAG Lastname COLLATE General
>
>This works fine for viewing records but now I have lost rushmore optimization on a few queries. This *used* to be optimizable under machine indexes:
>
><
>
>
>SELECT Lastname, Firstname ;
>   FROM Lawyers ;
>   WHERE UPPER(lastname) == UPPER(lcLastname) AND ;
>      UPPER(Firstname) == UPPER(lcFirstname) ;
>   INTO ARRAY laNames
>
><
>
>
>It was optimizable because the left side of the WHERE matched a tag. But now the tags do not include UPPER(). Users noticed a slowdown and so I investigated using SYS(3054) and found out that the above expression is no longer optimized. The other things I tried were:
>
>1) removing UPPER() from the left side of the above equation; did not help and wrong results
>
>2) adding the UPPER() back to the tag so that it matched but this did not help.
>
>Any way to get this optimized?
>
>Albert Gostick

Albert,
I would suggest keeping away from general and use something else like sys(15) for sorting.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform