"D'Arcy J.M. Cain" <darcy(at)druid(dot)net> writes:
> I had previously mentioned that queries run much different depending on
> whether a VACUUM ANALYZE is done or just a plain ANALYZE.
The problem appears to be that it's picking the wrong index to use for
the second part of the query (the certrans_active = 'f' part). You have
not shown us enough info to guess why though.
regards, tom lane