Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> 0001 fixes this by tracking the number of actually indexed rows in the
> build states, just like in the other index AMs.
> A VACUUM or ANALYZE will fix the estimate, of course, but for tables
> that are not changing very much it may take quite a while. So I think
> this is something we definitely need to back-patch.
Agreed, and done. I noticed a second bug in contrib/bloom, too: it'd
forget to write out the last index page if that contained only one
tuple, because the new-page code path in bloomBuildCallback failed to
increment the "count" field after clearing it.
> The 0002 part is the main part, unifying the definition of reltuples on
> three main places:
On to this part ...
regards, tom lane