Re: Recommendations for partitioning? - Mailing list pgsql-performance

From Alvaro Herrera
Subject Re: Recommendations for partitioning?
Date
Msg-id 20131220155954.GB22570@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: Recommendations for partitioning?  (Dave Johansen <davejohansen@gmail.com>)
Responses Re: Recommendations for partitioning?  (Shaun Thomas <sthomas@optionshouse.com>)
Re: Recommendations for partitioning?  (Sergey Konoplev <gray.ru@gmail.com>)
List pgsql-performance
Dave Johansen escribió:
> On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe <scott.marlowe@gmail.com>wrote:

> > That's pretty much it. What I did was to create the new month table
> > and day tables, alter my triggers to reflect this, then move the data
> > with insert into / select from query for each old day partition. Then
> > once their data is moved you can just drop them. Since you changed the
> > triggers first those tables are no long taking input so it's usually
> > safe to drop them now.
>
> It would be nice if there was just a "move command", but that seems like
> the type of model that we want and we'll probably move to that.

Eh.  Why can't you just do something like

WITH moved AS (
    DELETE FROM src WHERE ..
    RETURNING *
) INSERT INTO dst SELECT * FROM moved;

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: slow query - will CLUSTER help?
Next
From: Shaun Thomas
Date:
Subject: Re: Recommendations for partitioning?