Re: Partitioning an existing table

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Partitioning an existing table
Date: 2011-04-25 10:57:56
Message-ID: BANLkTim2G4DmG1D-EsNqH=fkxAnZ7RUJfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/4/25 Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>:
> Hi.
>
> The partitioning documentation in PG is very clear on how to partition
> a new table. Create child tables, and have triggers that manage
> INSERT, UPDATE and DELETE commands.
>
> How about doing this with existing massive tables? (Over 120 million rows)
>
> I could create a new parent table with child tables, and then INSERT
> all these millions of rows to put them into the right partition. But
> is that recommended?

It will be faster to INSERT directly in the good child tables and you
can make multiple INSERT in parrallel (depend of your IO system and
number of tables)

>
> Thanks
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-04-25 13:07:19 Re: Partitioning an existing table
Previous Message Phoenix Kiula 2011-04-25 10:46:23 Partitioning an existing table