Re: matview niceties: pick any two of these three

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: matview niceties: pick any two of these three
Дата
Msg-id 10921.1367695848@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: matview niceties: pick any two of these three  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
... btw, I noticed a minor misfeature in the current implementation:

regression=# select pg_relation_size('int8_tbl');pg_relation_size 
------------------            8192
(1 row)

regression=# create materialized view mv1 as select * from int8_tbl;
SELECT 5
regression=# select pg_relation_size('mv1');pg_relation_size 
------------------           16384
(1 row)

So when populating a matview, we fail to make any use at all of the
initially-added page.  On the other hand,

regression=# vacuum full mv1;
VACUUM
regression=# select pg_relation_size('mv1');pg_relation_size 
------------------            8192
(1 row)

regression=# refresh materialized view mv1;
REFRESH MATERIALIZED VIEW
regression=# select pg_relation_size('mv1');pg_relation_size 
------------------           16384
(1 row)

I haven't looked into why the VACUUM FULL code path is able to make use
of the initially-created page while the CREATE/REFRESH code path can't.
Possibly it's due to some innocent-looking difference in order of
operations.  The details aren't really too relevant though.  Rather, my
point is that IMO this sort of bug is an inevitable consequence of the
layering violation that's at the heart of the current matview design.
If we stick with this design, I'm afraid we'll be squashing bugs of this
kind till kingdom come, and some of them may be much more painful to fix
than the ones we've found to date.  Layering violations tend to beget
more layering violations.
        regards, tom lane



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

Предыдущее
От: Stas Kelvich
Дата:
Сообщение: Re: Cube extension improvement, GSoC
Следующее
От: Tom Lane
Дата:
Сообщение: Re: erroneous restore into pg_catalog schema