Posts tagged Indexes

List of tables and indexes, with associated File Group

0
The script below (written using SQL Server 2005), returns a list of all tables (along with the schema name), and indexes (where they exist), and the name of the associated file group. This will useful to find out which objects have been assigned to the wrong file group. I have a database with over [...]

Non-clustered indexes

0
When creating non-clustered indexes, you should never include the clustered index key fields (commonly used for the primary key) as part of the non-clustered index. This is because the fields will always be used within queries.  There is no need to specify them again. The only exception to this, [...]

Rebuild or Reorganize Indexes?

0
The query below can be used to identify those indexes that should be rebuilt (using ALTER INDEX REBUILD WITH (ONLINE = ON), or those that should be reorganized (USING ALTER INDEX REORGANIZE): SELECT object_name(a.object_id) as TableName,     a.index_id,     a.Index_Type_Desc,     b.name AS [...]
Go to Top