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

From Robert Haas
Subject Re: WIP: cross column correlation ...
Date
Msg-id AANLkTind81SDsTqrsSnvoeMJeKbNafAtJXdW4=U1NkRa@mail.gmail.com
Whole thread Raw
In response to Re: WIP: cross column correlation ...  (Nathan Boley <npboley@gmail.com>)
Responses Re: WIP: cross column correlation ...  (PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>)
List pgsql-hackers
On Wed, Feb 23, 2011 at 12:50 AM, Nathan Boley <npboley@gmail.com> wrote:
>> 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);
>
> If you're going to go that far, why not just collect statistics on
> that specific predicate?
>
> ie,  ANALYZE SELECTIVITY ON tablename (x, y) WHERE (x < 5 AND y = 1);
>
> Then it won't fall subject to all of the pitfalls that Tom outlines below.
>
> Selectivities are easy to estimate if we know the predicate. They only
> become hard when they have to work for every possible predicate.

Fair point.

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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: How to extract a value from a record using attnum or attname?
Next
From: Robert Haas
Date:
Subject: Re: WIP: cross column correlation ...