ryan@paymentalliance.net writes:
> No the query usually returns between 0 and 5 rows. Usually not zero -
> most often 1.
Ah. You must have a few values that are far more frequent (like tens of
thousands of occurrences?) and these are throwing off the planner's
statistics.
7.2 will probably do better with this sort of data distribution, but for
now it's a difficult problem.
regards, tom lane