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

Tom,

> 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.

Yes.  It would also make FKs something more than just an annoying (and slow) 
constraint in PostgreSQL.   And it would be a performance feature that most 
other RDBMSs don't have ;-)

> 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.

EXISTS is more flexible than IN; how can you do a 3-column corellation on an 
IN clause?

The reason that I mention EXISTS is because that's where the lack of 
cross-column corellation is most dramatic; the planner seems to estimate a 
flat 50% for EXISTS clauses regardless of the content.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco




view thread (16+ messages)  latest in thread

Message-ID: <200305052133.33680.josh@agliodbs.com>
Permalink:  ../200305052133.33680.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200305052133.33680.josh@agliodbs.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 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: josh@agliodbs.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: Hypothetical suggestions for planner, indexing improvement
  In-Reply-To: <200305052133.33680.josh@agliodbs.com>
  References: <200305051219.58955.josh@agliodbs.com> <22292.1052195133@sss.pgh.pa.us> <200305052133.33680.josh@agliodbs.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