Re: pg_reorg in core? - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: pg_reorg in core?
Date
Msg-id CAP7Qgm=EaKJnDsJ03_Tzpo70U5DxK9=u60=1K6GOZF+U-fToFg@mail.gmail.com
Whole thread Raw
In response to pg_reorg in core?  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: pg_reorg in core?  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Thu, Sep 20, 2012 at 7:05 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Hi all,
>
> During the last PGCon, I heard that some community members would be
> interested in having pg_reorg directly in core.
> Just to recall, pg_reorg is a functionality developped by NTT that allows to
> redistribute a table without taking locks on it.
> The technique it uses to reorganize the table is to create a temporary copy
> of the table to be redistributed with a CREATE TABLE AS
> whose definition changes if table is redistributed with a VACUUM FULL or
> CLUSTER.
> Then it follows this mechanism:
> - triggers are created to redirect all the DMLs that occur on the table to
> an intermediate log table.
> - creation of indexes on the temporary table based on what the user wishes
> - Apply the logs registered during the index creation
> - Swap the names of freshly created table and old table
> - Drop the useless objects
>

I'm not familiar with pg_reorg, but I wonder why we need a separate
program for this task.  I know pg_reorg is ok as an external program
per se, but if we could optimize CLUSTER (or VACUUM which I'm a little
pessimistic about) in the same way, it's much nicer than having
additional binary + extension.  Isn't it possible to do the same thing
above within the CLUSTER command?  Maybe CLUSTER .. CONCURRENTLY?

Thanks,
-- 
Hitoshi Harada



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 64-bit API for large object
Next
From: Josh Kupershmidt
Date:
Subject: Re: pg_reorg in core?