Marcin Barczynski <mbarczynski@xxxxxxxxxxxxxxxxxxx> writes: > It turned out to be pg_attribute. It was bloated probably due to the large > number of temp tables created. > Are there any recommendations on how to prevent such a bloat from happening? You could perhaps apply more aggressive autovacuum settings to that catalog. That won't be enough to get rid of the existing problem; you'll likely need to do a VACUUM FULL on it to remove the bloat. But autovac ought to be able to keep up with things in future, if tuned right. My guess is that pg_class has also got a bloat problem, though perhaps not as severe. regards, tom lane