I have a table with 3 columns id safeid branchid
-some times I need to get records by safeid
so I have a safeid (INDEX)
-some times I need to get records by branchid
so I have a branchid (INDEX)
-some times I need to get records by safeid
and branchid
together . so the question is : Do I have to create another branchid_safeid (INDEX)
for the two columns together to make selection faster?
Another Question
the id
column is a unique primary key .. Do I need to create id (INDEX)
or the primary key is an index by itself