Postgres FM · Hands-On Engineering Podcasts · November 2026
Benchmarks had just shown a create-a-temp-table-per-transaction workload running far slower than the CTE version. The guest said temp tables still have a place for rare batch jobs; Nikolay gives his flat rule.
…So you have 17,000 transactions in the synthetic experiment. Because, okay, you are deleting rows. If we forget about that tuples and bloat, then we just avoid extra DDL and extra broadcast through that queue. So this is like slightly better, but I wouldn't still use temporary tables at all.
…you have to do some stuff. That's perfect. Like, do that. But don't use it as part of every search we do as our system grows and we do more. This is just going to compound on temp tables. Again, had I had to do it all over again, we would have not implemented what we did. So, and we will change it.
I know only one case where temp tables are needed: guys migrating from Oracle really want them. Beyond that, I cannot imagine any case where I would personally use temp tables at all. Zero.
Zero. Even if, like, for example, you're asked to do a bunch of data analysis and you have to take the data and massage it into a different structure so that you can then load it into what effectively is what management wants because it's being significantly pivoted, et cetera. And they're going to…
Follow me. And again, YouTube guys watching us on YouTube will see it in the center of the screen right now. So imagine you have a table and you select from it, select star from this table, right? Or select, let's name this table T1. You can say select star from the table and you will see the whole…
Select T1 from T1.