Conversation

We've finally upgraded to PostgreSQL 12, and the new BTree index mechanism provides pretty unexpected results. It's much more compact now than the hash index, at least for a column with lots of duplicates. New btree is 25 GB, new hash index is 38 GB (billion+ rows).
3
29
Sadly, I can’t provide additional numbers on that, as I have not tried to create a btree index on that column in pg11 before upgrade. I can probably find other btree indexes that aren’t upgraded yet, reindex and report the difference. Is it interesting?
2
We run pg_repack on a PG11 right before upgrade, because we didn’t have enough free space to upgrade. So almost all of these indexes aren’t bloated much. I’m not sure I have enough time and expertise to produce quality data on trends here, though
1
I have another table (225M rows) with a bigint column (96M distinct values, is a foreign key to other PK). New hash index is 7.6 GB, new btree index is 4.8GB. This isn't low cardinality for me! We've converted all our hash indexes to btree just yesterday.