Re: Query plan excluding index on view

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query plan excluding index on view
Дата
Msg-id 28880.1207369243@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query plan excluding index on view  ("Matt Klinker" <mklinker@gmail.com>)
Ответы Re: [SOLVED] Query plan excluding index on view  ("Matt Klinker" <mklinker@gmail.com>)
Список pgsql-performance
"Matt Klinker" <mklinker@gmail.com> writes:
> --Joined View:
> CREATE OR REPLACE VIEW directory_listing AS
>  SELECT school.id, school.name, school.description, 119075291 AS
> listing_type_fid
>    FROM school
> UNION ALL
>  SELECT company.id, company.name, company.description, 119074833 AS
> listing_type_fid
>    FROM company;

Ah, there's the problem :-(.  Can you get rid of the constants here?
The planner's currently not smart about UNION ALL subqueries unless
their SELECT lists contain just simple column references.

(Yes, fixing that is on the todo list, but don't hold your breath...
it'll be 8.4 material at the earliest.)

            regards, tom lane

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Partitioned tables - planner wont use indexes
Следующее
От: James Mansion
Дата:
Сообщение: Re: Performance Implications of Using Exceptions