Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect) - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Date
Msg-id 379FE9D5.430BB918@trust.ee
Whole thread Raw
In response to Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> (2) The statistics that we have available are stats about a column.
> Not stats about a column given the predicate of some index.  So there's
> no gain in our statistical knowledge either.

If we added just count of NULLs we would cover for the NOT NULL case

> Partial indexes might be a component of a solution, but they are
> very far from being a solution all by themselves.
> 
>                         regards, tom lane
> 
> PS: a quick glance at gram.y shows that we don't actually accept
> partial-index predicates in CREATE INDEX, so Andreas was right that
> the feature got ripped out at some point.  I have no idea how much
> work might be required to re-enable it... but I'll bet it's not
> trivial.

That's why I suggested getting just the simplest case (NOT NULL) 
working first.

The more general approach would of course be to gather stats by index.

--------------
Hannu


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Next
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] pg_dump not dumping all tables