If I have a UNIQUE index over multiple columns like this:
CREATE UNIQUE INDEX idx_name ON Tablename(column1, column2, column3)
When I run this SQL statement:
SELECT *
FROM Tablename
WHERE column1 = 'example'
My question: does the index for WHERE
work in this example? Or must a create another index?
OR the same with JOIN if I have:
SELECT *
FROM Tablename
JOIN Tablename2 ON Tablename.column1 = Tablename2.othercolumn
Is this column now index at the right way for JOIN
and WHERE
?
Thanks