Christophe Pettus <xof(at)thebuild(dot)com> writes:
> Where in the optimizer code does PostgreSQL decide which of several possibly-matching partial indexes to use?
It costs them all out and uses the cheapest.
If the cost estimates come out exactly the same, you get an arbitrary
choice (I think probably always the index with smallest OID, but that's
an implementation artifact rather than something that's done explicitly
anywhere).
regards, tom lane