Re: proposal : cross-column stats - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: proposal : cross-column stats
Date
Msg-id 4D0BD91F.7050006@fuzzy.cz
Whole thread Raw
In response to Re: proposal : cross-column stats  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Dne 17.12.2010 22:24, Tom Lane napsal(a):
> That seems likely to be even more unreliable than our existing
> single-column estimates :-(
> 
>             regards, tom lane

Well, yes :-(

I guess this is a place where we could use a multi-column index, if it
contains all the interesting columns. We could scan the index, not the
whole table.

That could save us tremendous amount of I/O and should be quite precise
(unless it's severely bloated).

Another thing is those 'discrete' columns are usually quite stable, i.e.
there's usually a limited list of values and it does not change very
often. Think about ZIP codes, states, etc. And the combinations are
quite stable too (counties do not move to other states, etc.).

So I think scanning a reasonable part of a table should be enough in
these cases.

regards
Tomas


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: proposal : cross-column stats
Next
From: Alvaro Herrera
Date:
Subject: Re: ps_status on fastpath