"Grzegorz TaÅczyk" <goliatus@polzone.pl> writes:
> SELECT * FROM table WHERE id = myfunction('x', 10);
> There is an index created on id column, but query planner doesn't use it.
Have you declared myfunction as IMMUTABLE or STABLE? If it's volatile
then optimizing to an indexscan is incorrect and the planner won't do it.
regards, tom lane