|
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]
|