Re: Inserting millions of record in a partitioned Table

From: Vick Khera <vivek(at)khera(dot)org>
To: Job <Job(at)colliniconsulting(dot)it>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inserting millions of record in a partitioned Table
Date: 2017-09-20 20:46:41
Message-ID: CALd+dcf6QTOduB21kd=6JGBTd2aJu=KPGtNew0ViEr6KuzbRwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 20, 2017 at 10:10 AM, Job <Job(at)colliniconsulting(dot)it> wrote:

> We noticed that if we import directly into the global table it is really,
> really slow.
> Importing directly in the single partition is faster.
>
>
Do you have a rule or trigger on the main table to redirect to the
partitions? You should expect that to take some extra time *per row*. Your
best bet is to just import into the proper partition and make sure your
application produces batch files that align with your partitions.

Either that or write a program that reads the data, determines the
partition, and then inserts directly to it. It might be faster.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2017-09-20 20:54:32 Re: Inserting millions of record in a partitioned Table
Previous Message Tom Lane 2017-09-20 19:39:01 Re: Puzzled by UNION with unknown types