pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Hypothetical suggestions for planner, indexing improvement
Date: Tue, 06 May 2003 00:25:33 -0400
Message-ID: <22292.1052195133@sss.pgh.pa.us> (raw)
In-Reply-To: <200305051219.58955.josh@agliodbs.com>
References: <200305051219.58955.josh@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:
> THE IDEA:  The planner should keep statistics on the correlation of foreign 
> keys and apply them to the expected row counts for EXISTS clause limitations,
> and possibly for other query types as well.

It's a thought.  Keeping complete cross-column correlation stats (for
every combination of columns in the DB) is obviously out of the
question.  If you're gonna do it you need a heuristic to tell you which
combinations of columns are worth keeping track of --- and foreign-key
relationships seem like a reasonable guide to the interesting
combinations.

I'm not sure about the long-term usefulness of optimizing EXISTS per se.
Seems to me that a lot of the present uses of EXISTS are workarounds
for Postgres' historic mistreatment of IN ... which we've attacked more
directly for 7.4.  But cross-column correlations are certainly useful
for estimating join sizes in general.

			regards, tom lane




view thread (16+ messages)  latest in thread

Message-ID: <22292.1052195133@sss.pgh.pa.us>
Permalink:  ../22292.1052195133@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22292.1052195133@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com, pgsql-hackers@postgresql.org
  Subject: Re: Hypothetical suggestions for planner, indexing improvement
  In-Reply-To: <22292.1052195133@sss.pgh.pa.us>
  References: <200305051219.58955.josh@agliodbs.com> <22292.1052195133@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