• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • 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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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