Quote:
|
Originally Posted by Zamolxe
I need to put an UNIQUE on (email_id, list_id).
|
i would just make them the primary key instead
Quote:
|
Originally Posted by Zamolxe
Do i also need to put INDEX on email_id and list_id separately?
|
no!!
primary keys get a unique index by default
but you might add an index on ( list_id , email_id )
this index, along with the primary key index, ensure that all queries will use one or the other index, and both of them are likely to be a
covering index