Skip site navigation (1) Skip section navigation (2)

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: 2005-12-27 15:24:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"Grzegorz Taczyk" <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

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-12-27 15:29:55
Subject: Re: BUG #2125: SELECT problem with strings containing \
Previous:From: Tom LaneDate: 2005-12-27 15:22:28
Subject: Re: BUG #2127: Regular Expression Limits Do Not Work

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group