Skip site navigation (1) Skip section navigation (2)

Re: WIP: cross column correlation ...

From: Nathan Boley <npboley(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>, Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Subject: Re: WIP: cross column correlation ...
Date: 2011-02-23 05:50:50
Message-ID: AANLkTimLFwakAxeSvjBwBo_sdzGrbeBP9a=BrDkDLn6O@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
> 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.

Best,
Nathan

In response to

Responses

pgsql-hackers by date

Next:From: Tatsuo IshiiDate: 2011-02-23 06:39:52
Subject: Re: Correctly producing array literals for prepared statements
Previous:From: Kevin GrittnerDate: 2011-02-23 05:20:25
Subject: Re: SSI bug?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group