Re: [BUGS] BUG #14753: Bad selectivity estimation with functional partial index - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14753: Bad selectivity estimation with functional partial index
Date
Msg-id 27613.1500479123@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] BUG #14753: Bad selectivity estimation with functional partial index  (dilaz03@gmail.com)
List pgsql-bugs
dilaz03@gmail.com writes:
> Postgres doesn't see corresponding stats tuple for functional partial
> index.

That's not a bug, it's intentional, per the comment in examine_variable():
                        * Has it got stats?  We only consider stats for                        * non-partial indexes,
sincepartial indexes probably                        * don't reflect whole-relation statistics; the above
        * check for uniqueness is the only info we take from                        * a partial index.
 

It's theoretically possible that we could do something useful with stats
from a partial index, but it would require a lot of shaky assumptions
I'm afraid.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: dilaz03@gmail.com
Date:
Subject: [BUGS] BUG #14753: Bad selectivity estimation with functional partial index
Next
From: Chris Pacejo
Date:
Subject: Re: [BUGS] BUG #14691: Isolation failure in deferrable transactionconcurrent with schema change