Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inefficiency of Empty JSONB Objects #667

Closed
jonas-jasas opened this issue Dec 22, 2024 · 1 comment
Closed

Inefficiency of Empty JSONB Objects #667

jonas-jasas opened this issue Dec 22, 2024 · 1 comment

Comments

@jonas-jasas
Copy link

Migrated to mobility 1.3.1 and had to change all JSONB NULL values to {} (related issue #666). NULL takes no space, while {} takes ~20b. I have the table with the many records and just few contains JSONB field values. As the result of changing NULL to {} database doubled in size from 40Gb to 80Gb.

Any suggestions how to solve this database size issue?

@jonas-jasas
Copy link
Author

For everyone who goes through this operation:
Converting from NULL to {} unexpectedly reserves crazy amounts of disk space. Just by running VACUUM (FULL); reclaims all that space. Vacuum operation executes surprisingly fast, not sure if it is related to this particular operation or to PG v17. In my case database deflated from 80Gb to 40Gb in just 20min on a slow VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant