July 19, 2007 at 3:58 am
Hi All,
I am pretty much a novice when it comes to query tuning so I would like some advice. I have a long running query which I have broken down to try to establish where the problems lie.
I have issued a query against 1 large table (28 million rows!) with 3 where clauses. I have viewed the estimated execution plan and a Bookmark Lookup is taking up 69% of the cost to the batch.
What does this operator do and what can I look at to improve the performance of this query?
I am only carrying out a count(*) and the query returns 32k rows anything between 30 secs and 3 mins. This is probably down to the activity on the server.
I would appreciate your views?
Thanks.
July 19, 2007 at 6:22 am
HI Adam,
Could you please post the query you are running.
I'll then have a look at this and try and point you in the correct direction.
thanks
Chris
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
July 19, 2007 at 6:25 am
A bookmark lookup is when the query uses a non-clustered index to finds rows matching and then uses a clustered index to find the row in the table.
If you are doing just a count(*) then I suspect that one of the columns in the where clause is not in the index. If you add this column, the index becomes a covered index and the optimiser can resolve the count(*) just from the index without having to touch the table. It should be much faster.
J
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply