pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Linos <info@linos.es>
Cc: pgsql-performance@postgresql.org
Subject: Re: CTE vs Subquery
Date: Tue, 25 Oct 2011 12:43:45 -0400
Message-ID: <24672.1319561025@sss.pgh.pa.us> (raw)
In-Reply-To: <4EA6E252.6030002@linos.es>
References: <4EA6E252.6030002@linos.es>

Linos <info@linos.es> writes:
>     i am having any problems with performance of queries that uses CTE, can the
> join on a CTE use the index of the original table?

CTEs act as optimization fences.  This is a feature, not a bug.  Use
them when you want to isolate the evaluation of a subquery.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <24672.1319561025@sss.pgh.pa.us>
Permalink:  ../24672.1319561025@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24672.1319561025@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, info@linos.es
  Subject: Re: CTE vs Subquery
  In-Reply-To: <24672.1319561025@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