Re: Indexes - Mailing list pgsql-sql

From Aasmund Midttun Godal
Subject Re: Indexes
Date
Msg-id 20011013145706.15118.qmail@ns.krot.org
Whole thread Raw
In response to Re: Indexes  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
On Sat, 13 Oct 2001 14:17:48 GMT, "Aasmund Midttun Godal" <postgresql@envisity.com> wrote:
> On Fri, 12 Oct 2001 19:33:46 -0700 (PDT), Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:
> Well, then another question; will a function be only evaluated once inside a query with the specific arguments?
> 
> i.e.will
> 
> my_table
> 
> foo|bar
> 1  |2
> 1  |3
> 2  |1
> 1  |3
> 
> 
> SELECT foo, bar FROM my_table WHERE func(foo, bar);
> 
> will func be evaluated 3 or 4 times ?
> 
I did some research on this issue. and I noticed the following:

the func was executed for each row i.e. 4 times.
However if I set iscachable it was only executed 3 times.
Yet it was executed again next time I called the select (I would have expected it to still be cached) is this
intentional?

Or would it be a good idea to introduce a new option,

iscacheable (permanently cachable)
querycachable (cachable within a given query)

If there is some info on this issue please let me know!
> Aasmund Midttun Godal
> 
> aasmund@godal.com - http://www.godal.com/
> +47 40 45 20 46
Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46


pgsql-sql by date:

Previous
From: "guard"
Date:
Subject: Re: to_char()??
Next
From: Joel Burton
Date:
Subject: Re: GROUPING