Re: BUG #2126: Index usage for function value
- From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- To: "Grzegorz Ta czyk" <goliatus(at)polzone(dot)pl>
- Cc: pgsql-bugs(at)postgresql(dot)org
- Subject: Re: BUG #2126: Index usage for function value
- Date: Tue, 27 Dec 2005 10:24:12 -0500
- Message-id: <23098.1135697052@sss.pgh.pa.us> <text/plain>
"Grzegorz TaÅczyk" <goliatus(at)polzone(dot)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
Home |
Main Index |
Thread Index