pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory Stark <stark@enterprisedb.com>
To: Brian Herlihy <btherl@yahoo.com.au>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Join vs Subquery
Date: Thu, 03 May 2007 12:46:31 +0100
Message-ID: <874pmu2kq0.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <243066.5712.qm@web52308.mail.re2.yahoo.com>
References: <243066.5712.qm@web52308.mail.re2.yahoo.com>

"Brian Herlihy" <btherl@yahoo.com.au> writes:

> There is a unique index mapping domains to domain_ids.
...
> The issue: the second query results in a lower cost estimate. I am wondering
> why the second query plan was not chosen for the first query.

Well the unique index you mentioned is critical to being able to conclude the
queries are equivalent. Postgres in the past hasn't been able to use things
like unique indexes to make planning decisions because it had no
infrastructure to replan if you dropped the index. We do have such
infrastructure now so it may be possible to add features like this in the
future.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com




view thread (4+ messages)  latest in thread

Message-ID: <874pmu2kq0.fsf@oxford.xeocode.com>
Permalink:  ../874pmu2kq0.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/874pmu2kq0.fsf@oxford.xeocode.com

 · 

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: stark@enterprisedb.com, btherl@yahoo.com.au
  Subject: Re: Join vs Subquery
  In-Reply-To: <874pmu2kq0.fsf@oxford.xeocode.com>

* 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