I've made a quick regarding the index, it seems not very useful - once the rows are filtered on inventory_id, PG prefers to simply do a table scan + sort rather than an index scan.
The only point I see in this index would be to let the DBA schedule a CLUSTER on it to speed up the table scan, but that's a bit overkill for most cases I suppose.
I've made a quick regarding the index, it seems not very useful - once the rows are filtered on inventory_id, PG prefers to simply do a table scan + sort rather than an index scan.
The only point I see in this index would be to let the DBA schedule a CLUSTER on it to speed up the table scan, but that's a bit overkill for most cases I suppose.