i have a table which contains two columns: dte
and id
. together, these two identify a unique record. is there a difference in access time between setting a primary key using these two columns or just creating a regular index like so:
create index idx on mytable (dte, id)
create index idx2 on mytable (id)
i am looking for an answer specifically in terms of access time for joins with other tables that also have these two columns. in particular what seems weird is when i do explain
on a join, it tells me it needs to examine 15 rows in one of the tables where this pairing is once again unique.