Re: ALTER TABLE on system catalogs

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: ALTER TABLE on system catalogs
Дата
Msg-id CAN-RpxBcwA47BhtsX6KOLQKSCB4KfkUSbkizmoZgJLh=3+D4aA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE on system catalogs  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Список pgsql-hackers
I have a couple of thoughts here.

On Fri, Feb 8, 2019 at 4:35 AM Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote:
At Fri, 08 Feb 2019 12:03:31 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in <20190208.120331.167280496.horiguchi.kyotaro@lab.ntt.co.jp>
> By the way, I'm confused to see that attributes that don't want
> to go external are marked as 'x' in system catalogs. Currently
> (putting aside its necessity) the following operation ends with
> successful attaching a new TOAST relation, which we really don't
> want.
>
> ALTER TABLE pg_attribute ALTER COLUMN attrelid SET STORAGE plain;
>
> Might be silly, we may need another storage class, say,
> Compression, which means try compress but don't go external.
>
> The attached patch does that.
>
> - All varlen fields of pg_class and pg_attribute are marked as
>   'c'.  (Catalog.pm, genbki.pl, genbki.h, pg_attribute/class.h)
>
> - Try compress but don't try external for 'c' storage.
>   (tuptoaster.c, toasting.c)
>
>
> We could remove toast relation when no toastable attribute
> remains after ATLER TABLE ALTER COLUMN SET STOAGE, but it doesn't
> seem that simple. So the storage class is for internal use only.

I guess there is a serious question why this is for internal use only.   Are there any particular cases where this would be problematic for those who know what they are doing to set?  If not, maybe it should be included in the docs?

I found that "ALTER TABLE.. SET STORAGE plain" doesn't remove
toast relation, so it's not so bad even if compress does the
same?

The attached 0001 is fixed from the previous version. 0002 is the
syntax.

I agree that we need to support setting options on tables in system catalogs.  We have some cases where we want to disable autovacuum on some table spaces, but set it aggressively on a couple system catalogs. Currently this is not really doable in any sane way.

I also think that if the current catalogs violate expectations regarding precondition checks this needs to be corrected rather than special-cased and this seems to be the best way forward.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center


--
Best Regards,
Chris Travers
Head of Database

Tel: +49 162 9037 210 | Skype: einhverfr | www.adjust.com 
Saarbrücker Straße 37a, 10405 Berlin

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Cache relation sizes?
Следующее
От: Andrey Borodin
Дата:
Сообщение: Re: [WIP] CREATE SUBSCRIPTION with FOR TABLES clause (table filter)