On Sun, 2005-01-16 at 17:45 +0100, Bo Lorentsen wrote: > Ragnar Hafstað wrote: > >when a volatile function is used thus: > > SELECT * FROM mytable WHERE col=myvolatilefunc(); > >the planner must call the function once per table row, and assume > >possibly different return values each time, so an indexscan will > >not improve timings. > > > > > Why not use the index scan for every row, is this a "limit" in the > planner ? I think there is something in the planner I don't understand :-) the planner will just use the plan it estimates will be fastest. because of how indexscans work in postgresql, in this case it would be slower than a tablescan (assuming the function really is volatile) gnari ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings