Question of the Day Two

Today we continue our series with our second question of the day.

What is the difference between a clustered and non-clustered index?

In simplest terms, a clustered index is the actual data, reordering the way that the records are physically stored.  Because of this, each table can only contain one clustered index.

However, a non-clustered index is more like a pointer to the actual record.  The logical order of the non-clustered index does not usually match how the data is stored physically.

There is also a third option, the heap, which is a table without an index at all.  Without an index, the server would have to read through all of the records in order to find the data queried.  Enjoy!

Advertisements

About SQLGator

Florida Gator and Microsoft Data Platform MVP, Star Wars fanatic and is there anything else...oh yeah PS4! I am a geek and SQL Server DBA who dabbles with VMWare, there are other technologies greater than these? Not so fast my friend! I also love to travel to new and exotic places.

Posted on August 4, 2012, in SQL Schoolhouse and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: