在我的 Postgres 事务之一(执行过程)中,我使用了 50 多个临时表,并且为每个临时表创建了 pg_toast_temptableOID、pg_toast_temptableOID_index 以及 AccessExclusiveLock 和 fastpath = false 。它导致我的程序执行缓慢。请让我知道如何提高性能。
注意:我使用临时表,因为传入的数据很大,CTE 会使其非常慢。
VACUUM
ANALYZE