• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Unindexed column used by Query Optimiser

Can someone please tell me how I can extract Unindexed columns used by Query Optimiser. My understanding is that the query optimiser creates a temporary index for colums which ideally would have been indexed. I would like to gather info on these indexes and possibly create permanent indexes for some of temporarily created indexes. Thanx
0
MSSexpert
Asked:
MSSexpert
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
The query optimizer creates some lookup tables for those columns referenced in the where clause, using any available indexes in the table. You can see this in the Query execution plan as 'Bookmark Lookup'
0
 
imran_fastCommented:
Why wont you use Index tuning wizard to create indexes, statistics and optimize the quries.
0
 
Scott PletcherSenior DBACommented:
>> My understanding is that the query optimiser creates a temporary index for colums which ideally would have been indexed. <<

Yes, SQL will create its own statistics, which appear as an index in system tables.

The "index" name begins with "_" (underscore), so to find them all, assuming you don't name your own indexes beginning with an _:


select left(object_name(id), 50) AS [Table Name],
    parsename(replace(substring(name, 2, 200), '_', '.'), 2) AS [Column Name With Stats]
from sysindexes
where name like '~_%' ESCAPE '~'
order by 1, 2
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now