November 5, 2004 at 12:23 pm
Why will this query not find any indexs?
select
(select Points from scoring s1 WHERE s1.userID=s.userid AND s1.weekNum=1),
s.rank
From scoring s
where s.groupid=3392 and s.weeknum=8 and rank>0 and rank<=40 order by rank
I want the rank column of the returned rows to be from week 8 and the points column to be from week 1.
This query is not fining any indexes! Is there a better way to do this?
November 8, 2004 at 8:00 am
This was removed by the editor as SPAM
November 8, 2004 at 9:45 am
What indexes are on the table? How many rows? Are you sure statistics are up to date?
November 8, 2004 at 2:58 pm
There could be several different answers to your question. How many rows are in the table? How often is the table updated or new information inserted? What are the current indexes? Have you established a benchmark on the difference between using an index and not using it?
Quand on parle du loup, on en voit la queue
November 11, 2004 at 1:34 pm
If you have access to BOL (2004) please look for the item FROM and look for the chapter TABLE HINT There you can find your answer ( I hope )
GKramer
The Netherlands
November 14, 2004 at 4:08 am
I've found that if I transfer the passed in parameters to local variables declared in the stored procedure where this query is called, the query does find the indexes on the table.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply