Andrew McMillan wrote:
> 
> Tom Lane wrote:
> >
> >         begin;
> >         select * from foo where x = functhatreadsbar();
> >         update bar ...;
> >         select * from foo where x = functhatreadsbar();
> >         end;
> >
> > does not give you the desired results.
> 
> But why would you be marking the function 'iscachable' if you wanted to see the
> change there?
Because if there is an index on 'x' you would want to use it instead of
performing a full table scan. If table 'foo' has millions of records, and
functhatreadsbar() return one value, an operation that can take milliseconds,
not takes seconds with no benefit.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to