2 ms·
https://wiki.postgresql.org/wiki/Loose_indexscan https://wiki.postgresql.org/wiki/Loose_indexscan > "Loose indexscan" in MySQL, "index skip scan" in Oracle, SQ
by MuffinFlavored 4y ago
https://wiki.postgresql.org/wiki/Loose_indexscan https://wiki.postgresql.org/wiki/Loose_indexscan
> "Loose indexscan" in MySQL, "index skip scan" in Oracle, SQLite, Cockroach (very recently added), and "jump scan" in DB2 are the names used for an operation that finds the the distinct values of the leading columns of a btree index efficiently; rather than scanning all equal values of a key, as soon as a new value is found, restart the search by looking for a larger value. This is much faster when the index has many equal keys.
I ran into a case in a hobby project where a really basic GROUP BY query was performing was worse than it should. I was surprised that https://malisper.me/the-missing-postgres-scan-the-loose-index-scan/ https://malisper.me/the-missing-postgres-scan-the-loose-inde... it's been known "missing" since 2017.
- qeternity 4y agoFYI: TimescaleDB includes a skip scan operation which can be used on regular Postgres tables.