From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, Jeff Davis <pgsql(at)j-davis(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Stats for multi-column indexes |
Date: | 2007-03-20 12:42:08 |
Message-ID: | 20070320124208.GL24234@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Richard Huxton wrote:
> Simon Riggs wrote:
> >On Tue, 2007-03-20 at 14:14 +1200, Mark Kirkwood wrote:
> >>Jeff Davis wrote:
> >>>I know we can't keep stats on every combination of columns. My initial
> >>>idea would be to only keep stats about a multi-column index (and
> >>>probably optional for those, too).
> >>>
> >>Maybe you would want to keep single column indexes too, so that (more)
> >>accurate estimates for bitmap-and type plans are possible.
> >
> >We should allow the DBA to specify which groups of cols to keep
> >statistics on, if there is no index on that group.
> >
> >That solves the combinatorial explosion problem.
>
> This is one hint I think everyone can agree on. Being able to say that
> values in different columns are related just gives the planner more
> information to work with.
It was also suggested that column pairs in FK relationship could be
automatically enabled. So you don't need to specify those manually.
Now, the hard question is deciding what to keep track of. I don't think
MCV makes much sense, because what's the MCV of two columns? Some sort
of correlation index would seem to make certain sense.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2007-03-20 12:48:30 | Re: Stats processor not restarting |
Previous Message | Magnus Hagander | 2007-03-20 11:23:50 | Stats processor not restarting |