Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Pretty New To Indexes...

Author  Topic 

noyellatmonkeys
Starting Member

15 Posts

Posted - 2010-02-04 : 19:16:04
Hey All,

I have a question... so im just learning how to use indexes to speed up some complex queries but I have a question...

so on a table that i want to create a few indexes on (lets say 3 or 4) is it better to create an individual index for each one... or one index with multiple columns?

Thanks,

~ Mauricio

p.s. this is a memeber signup table that has new signups added daily

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-04 : 20:19:45
There is no general answer for your question, it depends on the queries. The queries are what determine what indexes to create.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

vmenon
Starting Member

17 Posts

Posted - 2010-02-05 : 01:08:40
Basic Rule --> every table should at least have a clustered index.

Important:

Columns that are frequently accessed by the WHERE, ORDER BY, GROUP BY, TOP, and DISTINCT clauses are ideal candidates for participating in an index

Also remember that over indexing your OLTP tables increases the time taken to perform insert, updates and deletes.

Only add indexes on columns if you are sure they are used by queries that run against the table. Un-used indexes slow data modifications, causes un-necessay IO while reading pages, and also consumes space which I would term as unwanted.
Go to Top of Page
   

- Advertisement -