Re: WIP: cross column correlation ... - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WIP: cross column correlation ...
Date
Msg-id AANLkTikYR1KJf-AyyejD3E+SjAYLCi2cEj8SCYRY7QJE@mail.gmail.com
Whole thread Raw
In response to WIP: cross column correlation ...  (PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>)
Responses Re: WIP: cross column correlation ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: WIP: cross column correlation ...  (Nathan Boley <npboley@gmail.com>)
Re: WIP: cross column correlation ...  (PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>)
Re: WIP: cross column correlation ...  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
2011/2/22 PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at>:
> how does it work? we try to find suitable statistics for an arbitrary length list of conditions so that the planner
canuse it directly rather than multiplying all the selectivities. this should make estimates a lot more precise. 
> the current approach can be extended to work with expressions and well as "straight" conditions.

/me prepares to go down in flames.

Personally, I think the first thing we ought to do is add a real, bona
fide planner hint to override the selectivity calculation manually,
maybe something like this:

WHERE (x < 5 AND y = 1) SELECTIVITY (0.1);

Then, having provided a method for the DBA to extinguish the raging
flames of searing agony which are consuming them while a crocodile
chews off their leg and their boss asks them why they didn't use
Oracle, we can continue bikeshedding about the best way of fixing this
problem in a more user-transparent fashion.

As to the approach you've proposed here, I'm not sure I understand
what this is actually doing.  Selectivity estimates aren't made
directly for predicates; they're made based on MCV and histogram
information for predicates.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Snapshot synchronization, again...
Next
From: Robert Haas
Date:
Subject: Re: Snapshot synchronization, again...