PostgreSQL Index Types: When B-Tree Loses to BRIN, GIN, and GiST
We replaced a 40 GB B-tree on created_at with a 40 MB BRIN and the time-range queries got faster, not slower. Here is how to pick between B-tree, BRIN, GIN, GiST, and hash by query shape.