An unexpected find that freed 20GB of unused index space in PostgreSQL
1–10 of 81 posts
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#2It looks like in v13+ PostgreSQL could create a single leaf for NULL data and just store row pointers within it, which should reduce data sizes at least a bit.
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#3Indexing boolean columns is often only useful if one of the values is uncommon and the index is partial to only include those uncommon rows.
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#4Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#5We have one huge table I want to add some indexes for specific cases (for max 1% of records) but server will not have enough memory for it if I add those indexes for all records :/
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#6Partial indexes can be useful in any case where one value has much higher cardinality than others. Indexing boolean columns is often only useful if one of the values is uncommon and the index is partial to only include those uncommon rows.
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#7Too bad MySQL does not have partial indexes. We have one huge table I want to add some indexes for specific cases (for max 1% of records) but server will not have enough memory for it if I add those indexes for all records :/
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#8Is the partial index technique to avoid indexed NULL data as effective for PostgreSQL 13+? It looks like in v13+ PostgreSQL could create a single leaf for NULL data and just store row pointers within it, which should reduce data sizes at least a bit.
If I had to guess, I would say that it doesn't accomplish anything (or as much as you'd think) for null values simply because there is no real data to store in either approach, you just have a bunch of pointers either way.
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#9Is the partial index technique to avoid indexed NULL data as effective for PostgreSQL 13+? It looks like in v13+ PostgreSQL could create a single leaf for NULL data and just store row pointers within it, which should reduce data sizes at least a bit.
So, deduplication saves some 65% in index size for NULL-only index-tuples, and the further 35% can be saved by using a partial index (so, in this case, deduplication could have saved 13GB).
*note: last time I checked, REINDEX with deduplication enabled packs 50 duplicates in one compressed index tuple. This varies for naturally grown indexes, and changes with column types and update access patterns.
Re: An unexpected find that freed 20GB of unused index space in PostgreSQL
#10It means basically exporting your database (or tables) and importing it again. What happens is that deleted data which doesn't necessarily free up space (Oracle reuses the freed up space sometimes) doesn't get exported.
https://www.iri.com/blog/vldb-operations/database-reorgs-why...
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUEST...