Re: On query rewrite

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: On query rewrite
Дата
Msg-id 20040528004410.GB9889@dcc.uchile.cl
обсуждение исходный текст
Ответ на On query rewrite  (Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>)
Ответы Re: On query rewrite  (Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>)
Список pgsql-hackers
On Thu, May 27, 2004 at 05:14:48PM -0700, Sailesh Krishnamurthy wrote:

> Are there any default query rewrite rules that kick in, in the absence
> of any user-defined RULE or VIEW ?
> 
> Also, is there any place that lists any "interesting" query rewrite
> that PG does on queries for perf. improvement ? 
> 
> For instance, in the presence of a view or a subquery, does PG do a
> subquery to join transformation ?

Yes, there are transformations of this sort, but they are not called
query rewrite in the code's terminology, but "optimization" -- rewrite
(rules and views) happens to the parsed statement, and the optimizer
works on the output of rewriting.  So actually the optimizations happen
whether there were or not rules or views.

The query's path is
SQL -> parse -> rewrite -> optimize -> execute

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El número de instalaciones de UNIX se ha elevado a 10,
y se espera que este número aumente" (UPM, 1972)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sailesh Krishnamurthy
Дата:
Сообщение: On query rewrite
Следующее
От: pgsql@mohawksoft.com
Дата:
Сообщение: Re: tablespaces and DB administration