Re: Indexes

From: "Aasmund Midttun Godal" <aasmund(at)godal(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: sszabo(at)megazone23(dot)bigpanda(dot)com
Subject: Re: Indexes
Date: 2001-10-13 14:57:06
Message-ID: 20011013145706.15118.qmail@ns.krot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 13 Oct 2001 14:17:48 GMT, "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com> wrote:
> On Fri, 12 Oct 2001 19:33:46 -0700 (PDT), Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)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(at)godal(dot)com - http://www.godal.com/
> +47 40 45 20 46
Aasmund Midttun Godal

aasmund(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46

In response to

  • Re: Indexes at 2001-10-13 02:33:46 from Stephan Szabo

Browse pgsql-sql by date

  From Date Subject
Next Message Masaru Sugawara 2001-10-13 15:19:56 Re: MEDIAN as custom aggregate?
Previous Message Pat M 2001-10-13 12:55:14 Cenceptual help needed - periodic events