3 ms·
Yes, but I think it's understandable given that nothing in the spec suggests CTEs should affect performance. Practically speaking, though, CTEs can be used to
by AaronFriel 7y ago
Yes, but I think it's understandable given that nothing in the spec suggests CTEs should affect performance.
Practically speaking, though, CTEs can be used to organize code, and query plan generators/optimizers may take that into account. Or, as someone else added, PostgreSQL will materialize the CTE as if it were a temporary table being used as an input.
Almost all RDBMS advice is implementation specific, sadly.