pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Greco <David_Greco@harte-hanks.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: SOLVED - RE: Poor performance using CTE
Date: Wed, 14 Nov 2012 11:29:03 -0500
Message-ID: <20462.1352910543@sss.pgh.pa.us> (raw)
In-Reply-To: <187F6C10D2931A4386EE8E58E13857F61291D897@BY2PRD0811MB415.namprd08.prod.outlook.com>
References: <187F6C10D2931A4386EE8E58E13857F61291D897@BY2PRD0811MB415.namprd08.prod.outlook.com>

David Greco <David_Greco@harte-hanks.com> writes:
> Thanks, that did the trick. Though I'm still not clear as to why. 

PG treats WITH as an optimization fence --- the WITH query will be
executed pretty much as-is.  It may be that Oracle flattens the query
somehow; though if you're using black-box functions in both cases,
it's not obvious where the optimizer could get any purchase that way.

			regards, tom lane




view thread (16+ messages)  latest in thread

Message-ID: <20462.1352910543@sss.pgh.pa.us>
Permalink:  ../20462.1352910543@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20462.1352910543@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, David_Greco@harte-hanks.com, andrew@dunslane.net
  Subject: Re: SOLVED - RE: Poor performance using CTE
  In-Reply-To: <20462.1352910543@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox