At http://wiki.postgresql.org/wiki/CTEReadme it seems to suggest that a CTE is just rewritten and the resulting query is executed.
Kind regards/met vriendelijke groet,
Serge Fonville
Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
2012/10/9 Craig Ringer <ringerc@xxxxxxxxxxxxx>
Really good question, I too would be interested in this.On 10/06/2012 08:45 AM, Liam Caffrey wrote:
Hi,
If I run a CTE does that materialize the resulting data in the same (or
a similar) way as if I created a temp table and referred to that
instead? Or does the CTE keep the set in memory?
I'd expect it'd materialize to RAM if the result is within `work_mem` but I'd love to know for sure.
--
Craig Ringer
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general