Search Postgresql Archives

Re: Index optimization ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux