[dba-SQLServer] Adding indexes programmatically

Haslett, Andrew andrew.haslett at ilc.gov.au
Mon Dec 13 05:48:58 CST 2004


Sorry that should have been;

"Overall performance isn't *always* going to improve by adding an index on
every field.." 

-----Original Message-----
From: Haslett, Andrew [mailto:andrew.haslett at ilc.gov.au] 
Sent: Monday, 13 December 2004 9:31 PM
To: 'dba-sqlserver at databaseadvisors.com'
Subject: RE: [dba-SQLServer] Adding indexes programmatically

Are you sure you need to index every field?

There's quite a bit more to it compared to Access where you generally just
put an index on every field you think you might search on. Overall
performance isn't generally going to improve by adding an index on every
field..

Numerous factors come into play such as performance, placement (physically)
of indexes, types, disk space etc.  especially considering  the size of your
database..

There's a reason there's a course on this stuff.  Probably 3 days of the 5
day admin course covers indexes and its close to the most boring stuff I've
ever sat through!!

Easiest method is to usually let the wizard decide what indexes you need.  

-----Original Message-----
From: John W. Colby [mailto:jwcolby at colbyconsulting.com]
Sent: Sunday, 12 December 2004 4:05 PM
To: SQLServer
Subject: [dba-SQLServer] Adding indexes programmatically

Does anyone have code to add indexes to every field in a table?  I am
breaking the nVLDB table down into subsets of related fields in smaller
tables and need to index each field.  The PK field is just that, an integer
and unique.  The rest are just text fields and non-unique.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

IMPORTANT - PLEASE READ ******************** This email and any files
transmitted with it are confidential and may contain information protected
by law from disclosure. 
If you have received this message in error, please notify the sender
immediately and delete this email from your system. 
No warranty is given that this email or files, if attached to this email,
are free from computer viruses or other defects. They are provided on the
basis the user assumes all responsibility for loss, damage or consequence
resulting directly or indirectly from their use, whether caused by the
negligence of the sender or not.
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

IMPORTANT - PLEASE READ ******************** 
This email and any files transmitted with it are confidential and may 
contain information protected by law from disclosure. 
If you have received this message in error, please notify the sender 
immediately and delete this email from your system. 
No warranty is given that this email or files, if attached to this 
email, are free from computer viruses or other defects. They 
are provided on the basis the user assumes all responsibility for 
loss, damage or consequence resulting directly or indirectly from 
their use, whether caused by the negligence of the sender or not.



More information about the dba-SQLServer mailing list