pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Donald Fraser <postgres@kiwi-fraser.net>
Cc: [BUGS] <pgsql-bugs@postgresql.org>
Subject: Re: Index Ignored Due To Use Of View
Date: Wed, 23 Mar 2011 20:07:53 -0400
Message-ID: <8297.1300925273@sss.pgh.pa.us> (raw)
In-Reply-To: <479C9845FAF74274970CEF781EB9EF56@DEVELOP1>
References: <479C9845FAF74274970CEF781EB9EF56@DEVELOP1>

"Donald Fraser" <postgres@kiwi-fraser.net> writes:
> I found the solution to the problem and it would therefore appear as though this is not a bug!
> If I change the function definition to be "STABLE" instead of "VOLATILE", then the problem goes away.

Yeah, that's intentional.  If the planner flattens a view that has a
function in its output list, things get a lot less predictable about
when the function will be called.  For a volatile function, that can
matter a lot.  We used to flatten such views anyway, but we got enough
complaints that we changed it.

http://archives.postgresql.org/pgsql-committers/2006-08/msg00358.php

			regards, tom lane



view thread (4+ messages)

Message-ID: <8297.1300925273@sss.pgh.pa.us>
Permalink:  ../8297.1300925273@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8297.1300925273@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, postgres@kiwi-fraser.net
  Subject: Re: Index Ignored Due To Use Of View
  In-Reply-To: <8297.1300925273@sss.pgh.pa.us>
  References: <479C9845FAF74274970CEF781EB9EF56@DEVELOP1> <8297.1300925273@sss.pgh.pa.us>

* 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