Re: Query Planner Issue - View and regexp_replace? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Query Planner Issue - View and regexp_replace?
Date
Msg-id 5172.1203298950@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query Planner Issue - View and regexp_replace?  (Brandon Kane <brandonk98@yahoo.com>)
List pgsql-novice
Brandon Kane <brandonk98@yahoo.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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump, pg_restore and template relationships
Next
From: "Nicholas Hemley"
Date:
Subject: postgres 8.3 & ident authentication