Re: Selecting from a VIEW is NOT optimized like a similar SELECT statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Selecting from a VIEW is NOT optimized like a similar SELECT statement
Дата
Msg-id 5995.1068615993@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Selecting from a VIEW is NOT optimized like a similar SELECT statement  (SHADOWPLAY - Dave Adams <jugular@umbra.shadowplay.net>)
Список pgsql-bugs
SHADOWPLAY - Dave Adams <jugular@umbra.shadowplay.net> writes:
> When using a view on a table, a select on the view is not as optimized as
> a select directly from the table.

PG 7.3 is not very bright about pushing WHERE quals down into a
sub-select that involves DISTINCT ON.  7.4 is a tad smarter, and I think
it will handle your example nicely --- though there are certainly plenty
of similar-looking cases that are just plain not optimizable.  You might
find it interesting to compare the comments in the 7.3 and 7.4 versions
of
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/optimizer/path/allpaths.c
in particular the 1.99-1.100 diff.

            regards, tom lane

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

Предыдущее
От: Theodore Petrosky
Дата:
Сообщение: RC1 question of reloading data
Следующее
От: Tomas Szepe
Дата:
Сообщение: Re: RC1 question of reloading data