4 ms·
This is a limitation which is currently being worked on. The order will still matter of course but it will allow PostgreSQL to make some use of indexes even whe
by jeltz 2y ago
This is a limitation which is currently being worked on. The order will still matter of course but it will allow PostgreSQL to make some use of indexes even when the order of coulums does not match.
https://www.postgresql.org/message-id/CAH2-Wzmn1YsLzOGgjAQZdn1STSG_y8qP__vggTaPAYXJP%2BG4bw%40mail.gmail.com https://www.postgresql.org/message-id/CAH2-Wzmn1YsLzOGgjAQZd...
- johnthuss 2y ago>>> This is feasible in cases where the total number of distinct values in the column 'a' is reasonably small (think tens or hundreds, perhaps even thousands for very large composite indexes). It's great this is improving, but this is a fairly narrow improvement. Personally, the multi-column indexes I use would not be improved by this change since column 'a' does not store a "reasonably small" distribution of values.