Re: Query Planner Issue - View and regexp_replace?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brandon Kane <brandonk98(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Query Planner Issue - View and regexp_replace?
Date: 2008-02-18 01:42:30
Message-ID: 5172.1203298950@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Brandon Kane <brandonk98(at)yahoo(dot)com> writes:
> Yes, this turns out to be a volatile user-defined function. Is there
> some specific part of the documentation you can point me to that helps
> explain why a volatile function might affect the plan for a column not
> involved in select or join operations?

I don't believe it's documented anywhere outside the source code, but
the short explanation is that the planner won't flatten the view for
fear of introducing extra evaluations of the volatile function.
(The fact that it isn't actually used at all doesn't help, because
we don't know that at the point where this decision has to be made.)

You could search the archives for the discussions leading to this patch:
http://archives.postgresql.org/pgsql-committers/2006-08/msg00358.php

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nicholas Hemley 2008-02-18 10:54:30 postgres 8.3 & ident authentication
Previous Message Tom Lane 2008-02-18 01:35:17 Re: pg_dump, pg_restore and template relationships