How many people have ordered the database column types explicitly for better disk packing?
Conversation
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
Replying to
Saw a DB recently reclaim about 25% of their space from better bin packing. I was surprised to see it. Sure there are often other low hanging fruit too, unused indexes and bloat both being big factors, but was interesting to observe actual impact.
1
1
You’re unable to view this Tweet because this account owner limits who can view their Tweets. Learn more
I agree with 's assessment. It's not that there is no problem here; it's that the extent of the problem will vary significantly, sometimes within an individual table.
Reminds me of dubious B-Tree bloat estimation queries that assume space overhead of 10% is the norm. With some indexes that assumption actually is reasonable, with other indexes it isn't. You can assume that it averages out across indexes, but that seems unlikely to work out.
3
I’ve never done this myself, but I remember reading about Braintree doing it, and the gem they created to automate it.
Checking it again now it says they saved about 10%:
1
3
Oh yeah. That number seems far more reasonable to me. But hard to generalize here. Sometimes when you reduce heap fillfactor from the default of 100 to (say) 90, the table tends to be smaller over time - not larger. Second order effects can really matter, but are complicated.
2


