General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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,
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only