News for hackers. Stuff that matters.
Re:Postgres Indexes for Newbies by mdavidn on Thursday January 20, 2022 @12:13AM (#30004961)
Starting with PostgreSQL 11, B-tree indexes can store additional "non-key" columns in the index. These are kept in the index alongside the sorted key columns. This can avoid expensive sorts in certain query plans.

It's not perfect. Stale table statistics sometimes forces PostgreSQL to check table pages to confirm that rows are visible to the current transaction. Index-only scans don't support features like expressions either.

Re:Postgres Indexes for Newbies by brandmeyer on Thursday January 20, 2022 @09:10AM (#30009088)
Is there a way to get this behavior with the implicit index on the primary key?