pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 德哥 <digoal@126.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #10194: Stable function in select clause cann't be optimized to one call?
Date: Fri, 2 May 2014 08:13:49 +0800 (CST)
Message-ID: <76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com> (raw)
In-Reply-To: <4618.1398973036@sss.pgh.pa.us>
References: <20140501090904.1398.86628@wrigleys.postgresql.org>
	<4618.1398973036@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

HI, >Because its value might change between planning and execution.When in seqscan mode, stable function not be optimized to one-call .
But in index-scan mode, it's in one-call mode.
If its value might change between planning and execution. I think stable function also not allowed used in index scan mode.






--
公益是一辈子的事,I'm Digoal,Just Do It.




At 2014-05-02 03:37:16,"Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>digoal@126.com writes:
>> Why stable function in select clause cann't optimized to one time call?
>
>Because its value might change between planning and execution.
>
>There was some discussion awhile back of performing run-time caching of
>the result, but it isn't done yet, and would impose some costs of its own.
>
>BTW, this sort of question is not a bug.
>
>			regards, tom lane


view thread (3+ messages)

Message-ID: <76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com>
Permalink:  ../76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com/
Also on:    postgresql.org/message-id/76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: digoal@126.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #10194: Stable function in select clause cann't be optimized to one call?
  In-Reply-To: <76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com>
  References: <20140501090904.1398.86628@wrigleys.postgresql.org> <4618.1398973036@sss.pgh.pa.us> <76b7e55f.4fb0.145ba47aa11.Coremail.digoal@126.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox