You are here: Re: Key and Index on Same Column? « MsSQL Server « IT news, forums, messages
Re: Key and Index on Same Column?

Posted by Gert-Jan Strik on 08/28/05 17:52

"christopher.secord@gmail.com" wrote:
[snip]
> > This means
> > that if you remove all indexes, but keep all constraints, then the
> > database would still work properly (although it might be slow).
>
> Is there any situation where removing an index would cause the database
> to not function??

No, from a theoretical point of view, you never need to manually create
an index.

What I meant to say is if you remove the constraints (or never create
them in the first place), then you are very likely to get corruption in
your data, such as orphaned rows (missing Foreign Key), duplicate values
(missing Primary Key / Unique constraint), etc. If you have the proper
constraints in place, you can add or remove indexes without affecting
the correctness of the database.

Or course, from a practical point of view, you do need indexes. This is
because by default only Primary Keys and Unique constraints are
automatically indexed. Foreign Keys are not automatically indexed. Your
system would be unnecessarily slow without indexes (generally more I/O
needed), and SQL-Server's locking strategy would also be very limited,
which means lower concurrency (more users 'waiting' for their
transaction).

Gert-Jan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация