[dba-SQLServer] Index on view

jwcolby jwcolby at colbyconsulting.com
Tue Jun 19 15:34:53 CDT 2012


I have a pair of tables.  Both tables have a clustered index on an integer PK.  TableA the PK is an 
autonumber.  TableB the PK is the PK from TableA, i.e. it is 1 to 1.

TableA is updated monthly, TableA and TableB both get records added occasionally.  I just added 
about 180 million records to both tables.  I do occasionally delete records from both as the data ages.

For providing counts to my client I need to join the two tables on the PK, then pull a single field 
from TableA and a handful of fields from TableB.  From there I will be doing count / group by kind 
of things.

I created a view to pull all of the fields used in these counts.  I thought I would create an index 
on the view.

Is this a good idea?  I have never indexed a view but I know it is possible.

-- 
John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it




More information about the dba-SQLServer mailing list