In one of my Postgres Transaction (executing a procedure), I’m using more than 50 temp tables and for each temp table it is creating pg_toast_temptableOID, pg_toast_temptableOID_index with AccessExclusiveLock and fastpath = false for these pg_toast tables. It is creating slowness in my procedure execution. Please let me know how to improve the Performance.
Note: I’m using temp tables because the incoming data is huge and CTEs will make it very slow.
2
Answers
VACUUM
andANALYZE
for further optimization of database.Here are some methods which might solve your problem.
EXPLAIN
.