4 ms·
It's a composite index. A covering index would be this: ALTER TABLE staff ADD INDEX idx (last_name, first_name); SELECT first_name FROM staff WHERE last_name
by morgo 16y ago
It's a composite index. A covering index would be this:
ALTER TABLE staff ADD INDEX idx (last_name, first_name);
SELECT first_name FROM staff WHERE last_name = 'n';
A covering index is something very special - all results are returned from the index. Not all databases do this - Postgres does not, because it does not want to maintain all the versions (see MVCC in wikipedia) in the index.
- ams6110 16y agoIndeed you are correct.