Re: Feature: triggers on materialized views

Поиск
Список
Период
Сортировка
От Mitar
Тема Re: Feature: triggers on materialized views
Дата
Msg-id CAKLmikPoVqXtCU+r5-u+Hfskszr6Yft8Ou8zMo-2k-tqWDuE_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Feature: triggers on materialized views  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi!

On Wed, Dec 26, 2018 at 4:38 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Sounds like you could do this by fixing concurrent refresh to also work
> when the MV is WITH NO DATA.

Yes, I do not think this would be too hard to fix. I could do this nevertheless.

> > Ah, yes. I could just do TRUNCATE and INSERT, instead of heap swap.
> > That would then generate reasonable trigger calls.
>
> Right.

I have tested this yesterday and performance is 2x worse that heap
swap on the benchmark I made. So I do not think this is a viable
approach.

I am now looking into simply triggering TRUNCATE and INSERT triggers
after heap swap simulating the above. I made AFTER STATEMENT triggers
and it looks like it is working, only NEW table is not populated for
some reason. Any suggestions? See attached patch.


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Feature: temporary materialized views
Следующее
От: Tom Lane
Дата:
Сообщение: Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)