The hidden costs of CREATE TEMP TABLE: catalog bloat and LWLock:SInvalWrite | PostgresAI

postgres.ai21 min read

Creating temporary tables in hot PostgreSQL code causes catalog bloat, file creation overhead, and shared invalidation queue contention. Benchmarks show that a CTE or keeping a temp table per session with truncation performs significantly better than creating and dropping a temp table in every transaction. Open article →

More on this topic