Re: Parsing of VIEW definitions - Mailing list pgsql-general

From Tom Lane
Subject Re: Parsing of VIEW definitions
Date
Msg-id 4971.1044887561@sss.pgh.pa.us
Whole thread Raw
In response to Re: Parsing of VIEW definitions  (Eric B.Ridge <ebr@tcdi.com>)
List pgsql-general
"Eric B. Ridge" <ebr@tcdi.com> writes:
> So the text form of the Query *is* looked up in pg_rewrite on every
> use?  Or is it looked up only once (per backend maybe?)?  The docs
> didn't say... unless I overlooked it.

I think it's kept in the relcache, so in typical cases it'd be read
only once per backend.

> So what should be more efficient?  Re-parsing/planning the entire SQL
> string (w/ the "view" definition in-line) or actually using the view?

Planning cost will be the same either way.  Parsing costs should be
less, but on the other hand the rewriter will take some extra cycles.
My guess is it'd be about a wash --- but I've never tried to measure.

            regards, tom lane

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: PostgreSQL x Oracle
Next
From: "Fabrizio Ermini"
Date:
Subject: Re: PostgreSQL x Oracle