partitioning a table containing millions of records

Started by Andreas Jochemover 17 years ago3 messagesgeneral
Jump to latest
#1Andreas Jochem
andruit@gmx.de

Hi,
I have a question concerning the topic patitioning.

I have a table with millions of records and I would like to partition
it. I have already read the documentation but it could not answer my
question.

My question is, the following:
Do I have to create the master and child tables and so on before
inserting the data or is it also possible to partition a table which
already contains millions of records??? And how can I do this??? Has
anybody done this before???

Thanks.

Andi

#2Nikolas Everett
nik9000@gmail.com
In reply to: Andreas Jochem (#1)
Re: partitioning a table containing millions of records

There is no fast way to split an existing table into partitions. Create a
new parent table, create partitions, create the insert trigger, and then
INSERT INTO newparent SELECT * FROM unpartitioned. You may want to split
that into groups if you have many millions of rows.

On Sat, Oct 25, 2008 at 6:47 AM, Andreas Jochem <andruit@gmx.de> wrote:

Show quoted text

Hi,
I have a question concerning the topic patitioning.

I have a table with millions of records and I would like to partition it. I
have already read the documentation but it could not answer my question.

My question is, the following:
Do I have to create the master and child tables and so on before inserting
the data or is it also possible to partition a table which already contains
millions of records??? And how can I do this??? Has anybody done this
before???

Thanks.

Andi

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

#3Andreas Jochem
andruit@gmx.de
In reply to: Nikolas Everett (#2)
Re: partitioning a table containing millions of records

Thanks for your reply,

I gonna try your suggestion.

Andi

Nikolas Everett wrote:

Show quoted text

There is no fast way to split an existing table into partitions.
Create a new parent table, create partitions, create the insert
trigger, and then INSERT INTO newparent SELECT * FROM unpartitioned.
You may want to split that into groups if you have many millions of rows.

On Sat, Oct 25, 2008 at 6:47 AM, Andreas Jochem <andruit@gmx.de
<mailto:andruit@gmx.de>> wrote:

Hi,
I have a question concerning the topic patitioning.

I have a table with millions of records and I would like to
partition it. I have already read the documentation but it could
not answer my question.

My question is, the following:
Do I have to create the master and child tables and so on before
inserting the data or is it also possible to partition a table
which already contains millions of records??? And how can I do
this??? Has anybody done this before???

Thanks.

Andi

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