Indexing

Technical Article

Script to aid in Indexing Strategy

  • Script

When AUTOSTATS is used in a database, we can sometimes use these automatically generated statistics to find columns where SQL Server has built statistics on non-indexed columns that may benefit from an index. This script finds these columns and displays the selectivity of them. This script can be useful in troubleshooting poorly performing databases by […]

5 (1)

You rated this post out of 5. Change rating

2007-04-09 (first published: )

1,743 reads

Technical Article

Update statistics for all tables in any DB

  • Script

Most of the time even after executing dbcc dbreindex script on database you won't see much improvement in application/DB performance.  Thats because dbreindex creates statistics for all tables but it executes sp_updatestats which is like sample statistics. To get the maximum performance we had to execute Update statistics with fullscan on table. This simple will […]

4.75 (8)

You rated this post out of 5. Change rating

2006-12-22 (first published: )

20,449 reads

Technical Article

Quick Fix secondary Indexes ( SQL 2000 )

  • Script

In real world production tuning sometimes a "quick fix" is required. This script will generate index create scripts for any column ending ID which doesn't have an index. It's dirty and its quick but you might just be amazed by the results when run against your database!

You rated this post out of 5. Change rating

2007-07-11 (first published: )

492 reads

Technical Article

List all indexes with keys, description and size

  • Script

This script combines functionality of sp_helpindex and sp_spaceused to list all tables with individual indexes, their keys and description  (sp_spaceused cannot do that) and size in MB per individual index (sp_helpindex cannot do that either). Feel free to use and modify as you see fit. Hope it can help.

5 (9)

You rated this post out of 5. Change rating

2007-07-03 (first published: )

2,648 reads

Blogs

How to Run Databases on Kubernetes: An 8-Step Guide

By

In this step-by-step tutorial, learn how to run MySQL, PostgreSQL, MongoDB, and other stateful...

Episode 11 of Simple Talks: Oracle

By

The 11th episode is now live, recorded a few weeks ago at the PASS...

A New Word: Mornden

By

mornden – n. the self-container pajama universe shared by two people on a long...

Read the latest Blogs

Forums

What is the best index strategy for a table that gets truncated?

By water490

Hi everyone My SSIS package does a bulk insert of csv files into a...

Blob Storage automated downloads

By Brandie Tarvin

Dipping my toes into the waters of Azure and of course before I get...

Announcing SQL Server 2025

By Press Release

Comments posted to this topic are about the item Announcing SQL Server 2025

Visit the forum

Question of the Day

Running Steve's Code

Can you run this code in any of your SQL Server 2019 databases without error?

CREATE OR ALTER PROCEDURE [dbo].[StevesAmazingProc]
AS
    
        SELECT Consumer_ID ,
               Trend_Category ,
               Bit_Trace
        FROM    NewWorldDB.dbo.MarketTrend;
    
GO

See possible answers