Re: Hypothetical suggestions for planner, indexing improvement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hypothetical suggestions for planner, indexing improvement
Date: 2003-05-06 04:25:33
Message-ID: 22292.1052195133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Josh Berkus <josh(at)agliodbs(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2003-05-06 04:33:33 Re: Hypothetical suggestions for planner, indexing improvement
Previous Message Christopher Kings-Lynne 2003-05-06 04:24:30 Re: tablespace patch

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-05-06 04:33:33 Re: Hypothetical suggestions for planner, indexing improvement
Previous Message scott.marlowe 2003-05-05 22:22:10 Re: Looking for a cheap upgrade (RAID)