Upserting increased DB size
# help-and-questions
m
I use python's supabase client. I have a jsonb column where I inserted a wrong json. I selected 'id, jsonb_column', modified the json to make it 10 times smaller, and upserted the new json. With the old json the DB size was 380 MB. With the new one which is smaller it rose up to 442 MB. And as a json file, the json is only 15 MB. Basically, reducing the data size, increased the DB size.
v
Postgres needs to clean up old records. It periodically does this automatically, but generally it won't shrink the file it uses to store it. You can force it to shrink the table file using
vacuum full
or running any other command that rewrites the table, like
cluster
.