On 10/09/2012 05:53 PM, Serge Fonville wrote:
> This indeed is a very interesting question.
>
> At http://wiki.postgresql.org/wiki/CTEReadme it seems to suggest that a
> CTE is just rewritten and the resulting query is executed.
CTEs are an optimisation fence, so there's something more than a simple
rewrite.
--
Craig Ringer