Bill Chandler <billybobc1210@yahoo.com> writes:
> One final clue before I go: if I change my wildcard to
> 'NEPOOL%' from 'NEPOOL%REAL%' my query completes much
> faster.
Could we see the exact queries and EXPLAIN ANALYZE output for both
cases? I'm wondering if the plan changes. I think that the planner
will believe that the latter pattern is significantly more selective
(how much more selective depends on exactly which PG version you're
using); if this results in a bad row-count estimate then a bad plan
could get picked.
regards, tom lane