Michal Politowski <mpol+pg(at)meep(dot)pl> writes:
> Is it normal that plans using a scan on a partial unique index
> estimate that much more than one row is returned?
There isn't currently any special logic to recognize that case;
the estimate is just whatever is going to come out of the normal
statistics-based estimation.
I'm unsure how hard it'd be to improve the situation. If we've already
identified relevant partial indexes before any of the stats code has to
run then it'd be pretty easy, but that might be a bit fragile.
Anyway, the usual advice for such cases is to see if raising the
statistics target helps.
regards, tom lane