Gary Doades <gpd(at)cwcom(dot)net> writes:
> Is there someway to force the use of an index. Or at least get the
> backend to substitue the parameters in a function before doing the
> first query plan so it has more typical values to work with?
Could we see the EXPLAIN ANALYZE output for your problem query?
Table schemas (column data types and available indexes) are necessary
background for this type of question as well.
You might want to take the question to pgsql-performance, too ...
it's a tad off topic for -general.
regards, tom lane