Wednesday, May 23, 2012

How do UNIQUE indexes work on multiple columns?

just a quick question: how exactly does the unique index check the if the field(s) is(are) unique when added on multiple columns?



For example, if I add a UNIQUE index on the email,password columns, will the index check if:




  1. Is email unique AND is password unique, or

  2. The combination of email,password is unique, as in, it would allow u1@mail.com, 123 and u2@mail.com, 123



Apologies if my thoughts seem abrupt here, I'm having difficulty in expressing them today for some reason. Thanks in advance!





No comments:

Post a Comment