Premature view materialization in 8.2?

Поиск
Список
Период
Сортировка
От Jonathan Ellis
Тема Premature view materialization in 8.2?
Дата
Msg-id e06563880704051146r357cb15by7e498c6d796b093a@mail.gmail.com
обсуждение исходный текст
Ответы Re: Premature view materialization in 8.2?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
I have a query hitting a view that takes 0.15s on 8.1 but 6s on 8.2.3:

   select party_id from clan_members_v cm, clans c
   where cm.clan_id = c.id
     and c.type = 'standard'

The problem seems to be that clan_members_v contains a call to an
expensive function:

create or replace view clan_members_v as
select cm.clan_id, cm.user_id, cp.party_id, cm.date_accepted,
   p.name as party_name, p_tp_total(p.id)::int as tp_total
from clan_members cm, clan_participants cp, parties p
where cm.user_id = p.user_id
 and p.id = cp.party_id
;

p_tp_total takes around 50ms per row.

If I create clan_members_v without the function call, the original
query's speed goes to the 150ms range on 8.2 as well.

Is this a regression, or a "feature" of 8.2?

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

Предыдущее
От: Mark Lewis
Дата:
Сообщение: Re: a question about Direct I/O and double buffering
Следующее
От: Erik Jones
Дата:
Сообщение: Re: a question about Direct I/O and double buffering