By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Constraints vs Indexes

P: 8
Indexes are good for "select statement", bad for "inserts, updates, deletes", how does a constraint differ? I've created a constraint on a table as "unique", and later went in a created 6 indexes (not primary or foreign). Would it be better to build these as constraints even though they will only be used in a "select" clause?

thank you
Jul 2 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 534
Constraint is a concept, while index is a particular implementation of constraint.
A unique constraint is always implemented as an index, in other cases it can be also implemented with a trigger, and even as an attribute of a column definition.
I think the only difference between unique constraint and unique index is that the former can be deferred.
Jul 4 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.