Re: ALTER tbl rewrite loses CLUSTER ON index (consider movingindisclustered to pg_class)

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: ALTER tbl rewrite loses CLUSTER ON index (consider movingindisclustered to pg_class)
Дата
Msg-id CA+HiwqHn7PWZobKdTeg=T9xmkeecaC_uS01Emy8PGeGk9sUUxA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER tbl rewrite loses CLUSTER ON index (consider movingindisclustered to pg_class)  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: ALTER tbl rewrite loses CLUSTER ON index (consider movingindisclustered to pg_class)  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Hi Justin,

On Fri, Feb 7, 2020 at 11:39 PM Justin Pryzby <pryzby@telsasoft.com> wrote:
> On Thu, Feb 06, 2020 at 02:24:47PM -0300, Alvaro Herrera wrote:
> > On 2020-Feb-06, Justin Pryzby wrote:
> >
> > > I wondered if it wouldn't be better if CLUSTER ON was stored in pg_class as the
> > > Oid of a clustered index, rather than a boolean in pg_index.
> >
> > Maybe.  Do you want to try a patch?
>
> I think the attached is 80% complete (I didn't touch pg_dump).
>
> One objection to this change would be that all relations (including indices)
> end up with relclustered fields, and pg_index already has a number of bools, so
> it's not like this one bool is wasting a byte.
>
> I think relisclustered was a's clever way of avoiding that overhead (c0ad5953).
> So I would be -0.5 on moving it to pg_class..

Are you still for fixing ALTER TABLE losing relisclustered with the
patch we were working on earlier [1], if not for moving relisclustered
to pg_class anymore?

I have read elsewhere [2] that forcing ALTER TABLE to rewrite in
clustered order might not be a good option, but maybe that one is a
more radical proposal than this.

Thanks,
Amit

[1] https://postgr.es/m/CA%2BHiwqEt1HnXYckCdaO8%2BpOoFs7NNS5byoZ6Xg2B7epKbhS85w%40mail.gmail.com
[2] https://postgr.es/m/10984.1581181029%40sss.pgh.pa.us



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

Предыдущее
От: Kasahara Tatsuhito
Дата:
Сообщение: Re: small improvement of the elapsed time for truncating heap in vacuum
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: ALTER tbl rewrite loses CLUSTER ON index (consider movingindisclustered to pg_class)