# Nikolay Samokhvalov: The hidden costs of CREATE TEMP TABLE: catalog bloat and LWLock:SInvalWrite

Source: [Planet PostgreSQL](https://postgr.es/p/9Ch) · 2026-11-18 · Backend
Page: https://themorning.dev/story/nikolay-samokhvalov-the-hidden-costs-of-create-temp-table-catalog-bloat-and-lwlo-ae5a3622bd2d3e6b
Kind: research · Impact: medium

## In brief

- In Postgres 18, a CTE ran 23x the TPS of a temp table per transaction in the author's benchmark.
- With 5000 idle sessions, temp-table DDL reached 127 and 249 of a 500 TPS target in two runs.
- The article examines catalog bloat and LWLock:SInvalWrite contention as costs of CREATE TEMP TABLE.

## Why it matters

Temp tables created inside transactions can add significant overhead under high session counts, so teams with many connections may see lower throughput than expected.

## Versions

- PostgreSQL 18

## Coverage

- [Nikolay Samokhvalov: The hidden costs of CREATE TEMP TABLE: catalog bloat and LWLock:SInvalWrite](https://postgr.es/p/9Ch) — Planet PostgreSQL, 2026-11-18

Tags: postgresql, temp-tables, performance, catalog-bloat, lwlock, benchmarks

---

Brief generated by AI (claude-haiku-5-5) from the reporting listed under Coverage. Headlines belong to their publishers. The Morning Dev – https://themorning.dev
