Re: Parsing of VIEW definitions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Parsing of VIEW definitions
Дата
Msg-id 4971.1044887561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Parsing of VIEW definitions  (Eric B.Ridge <ebr@tcdi.com>)
Список 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 по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: PostgreSQL x Oracle
Следующее
От: "Fabrizio Ermini"
Дата:
Сообщение: Re: PostgreSQL x Oracle