pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Amit Langote <amitlangote09gmailcom@telsasoft.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: ALTER TABLE rewrite to use clustered order
Date: Sat, 08 Feb 2020 11:57:09 -0500
Message-ID: <10984.1581181029@sss.pgh.pa.us> (raw)
In-Reply-To: <20200208150453.GV403@telsasoft.com>
References: <20200208150453.GV403@telsasoft.com>

Justin Pryzby <pryzby@telsasoft.com> writes:
> On Thu, Dec 27, 2018 at 10:24:17AM -0300, Alvaro Herrera wrote:
>> I think it would be valuable to have those ALTER TABLE variants that rewrite
>> the table do so using the cluster order, if there is one, instead of the heap
>> order, which is what it does today.

> That's a neat idea.

TBH, I'm -1 on this.  The current behavior of preserving physical order is
perfectly sane, and it's faster than anything involving CLUSTER is going
to be, and if you try to change that you are going to have enormous
headaches with the variants of ALTER TABLE that would change the semantics
of the CLUSTER index columns.  (Unless of course your theory is that you
don't actually care exactly what the finished order is, in which case why
are we bothering?)

The proposed patch which *forces* it to be done like that, whether the
user wants it or not, seems particularly poorly thought out.

			regards, tom lane





view thread (2+ messages)

Message-ID: <10984.1581181029@sss.pgh.pa.us>
Permalink:  ../10984.1581181029@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10984.1581181029@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, alvherre@2ndquadrant.com, a.kondratov@postgrespro.ru, robertmhaas@gmail.com, michael@paquier.xyz, amitlangote09gmailcom@telsasoft.com
  Subject: Re: ALTER TABLE rewrite to use clustered order
  In-Reply-To: <10984.1581181029@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox