Re: efficiently migrating 'old' data from one table to another

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: efficiently migrating 'old' data from one table to another
Date: 2017-01-12 20:40:53
Message-ID: 13ea0eea-08e5-2917-20bd-ef85532663c2@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/12/2017 12:06 PM, Jonathan Vanasco wrote:
> I'm just wondering if there's a more efficient way of handling a certain periodic data migration.

partition the tables by some date interval such as week (if you do this
archiving weekly). each week, disconnect the oldest partition from the
'active' partition set, and add it to the 'archive' partition set.
voila, no inserts, deletes, or updates are done at all, just some
metadata operations.

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-01-12 21:45:32 Re: efficiently migrating 'old' data from one table to another
Previous Message btober@computer.org 2017-01-12 20:19:19 Re: efficiently migrating 'old' data from one table to another