Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Do you have a filter on the index? Filtered indexes cannot be optimized. I can't think of anything else off the top of my head.
HTH,
Jonathan
>I've got the simplest of queries that I cannot get to optimize. Table pastinvoices has a regular index with expression custID+poNum. The following two queries (hard coded for example only) return the proper invoice, but takes about 3 seconds. Running a query on the primary key (invnum), returns the record in .03 seconds.
>
>Here they are:
>
>select * from pastinvoices as pinv where pinv.custID = "149" and ;
> pinv.poNum = "143619" into cursor cp
>
>-- or --
>
>select * from pastinvoices as pinv where (pinv.custID + pinv.ponum = ;
> "149 143619 ") into cursor cp && padded on right in act of desperation
>
>My where clause is identical to one of my index expressions. SET OPTIMIZE = ON. Where is my shortcoming?
>
>About to revert to INDEXSEEK and manually build cursor,
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement