July 18, 2016 at 3:40 am
Hi Guys,
I have a question about using covering indexes within joins. If I use 1 column in a covering index and use it in a joins, I get a scan within my query plan.
Should I include all the columns in my joins that reference the covering index? The index has 3 columns but no 'includes' columns.
Regards
IC
July 18, 2016 at 3:45 am
What kind of scan - table scan, clustered index scan, or non clustered index scan? Please post the actual execution plan.
John
July 18, 2016 at 3:59 am
Further on John's reply, we need the table structures, the query and the actual execution plan, without the information it's only wild guesses.
July 18, 2016 at 4:08 am
Don't worry....I already figured it out.
Its a clustered index scan and when I include both indexes in the joins it returns a Seek instead of a Scan.
July 18, 2016 at 6:21 am
Imke Cronje (7/18/2016)
Don't worry....I already figured it out.Its a clustered index scan and when I include both indexes in the joins it returns a Seek instead of a Scan.
Now all you have to worry about is how many times it does the seek. Seriously. See the properties window on the icon.
As a bit of a sidebar, a seek on the execution plan is not always better than a scan, especially if a seek is done once for each row.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy