Re: BUG #14753: Bad selectivity estimation with functional partial index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dilaz03(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14753: Bad selectivity estimation with functional partial index
Date: 2017-07-19 15:45:23
Message-ID: 27613.1500479123@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

dilaz03(at)gmail(dot)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, since partial 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Pacejo 2017-07-19 17:39:39 Re: BUG #14691: Isolation failure in deferrable transaction concurrent with schema change
Previous Message dilaz03 2017-07-19 15:20:38 BUG #14753: Bad selectivity estimation with functional partial index