pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Karthik K <kar6308@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Insert into on conflict, data size upto 3 billion records
Date: Mon, 15 Feb 2021 12:47:11 -0700
Message-ID: <6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com> (raw)
In-Reply-To: <CAExg72f2xosd7iynrk3dYFjEnwDRSS2tiMt7FnaHfG2e2qrCuQ@mail.gmail.com>
References: <CAD-twtSfABMBH3ODxJiKdh6FHBtB0UuXn4mN-xwnC7tb=Cphjg@mail.gmail.com>
<2a876340-e227-c96a-1d79-f8a74aa45e4a@gmail.com>
<CAExg72eOp0cOmaptkO9B09yErd7hEKjxe=PVUcGqX5RoJ0jWKg@mail.gmail.com>
<5ebe9fe2-3546-14f4-cd59-0b7335e26a40@gmail.com>
<CAExg72f2xosd7iynrk3dYFjEnwDRSS2tiMt7FnaHfG2e2qrCuQ@mail.gmail.com>
On 2/15/21 12:22 PM, Karthik K wrote:
> yes, I'm using \copy to load the batch table,
>
> with the new design that we are doing, we expect updates to be less
> going forward and more inserts, one of the target columns I'm updating
> is indexed, so I will drop the index and try it out, also from your
> suggestion above splitting the on conflict into insert and update is
> performant but in order to split the record into batches( low, high) I
> need to do a count of primary key on the batch tables to first split it
> into batches
>
>
I don't think you need to do a count per se. If you know the
approximate range (or better, the min and max) in the incoming/batch
data you can approximate the range values.
view thread (7+ messages)
Message-ID: <6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com> Permalink: ../6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com/ Also on: postgresql.org/message-id/6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-general@postgresql.org Cc: robjsargent@gmail.com, kar6308@gmail.com Subject: Re: Insert into on conflict, data size upto 3 billion records In-Reply-To: <6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com> References: <CAD-twtSfABMBH3ODxJiKdh6FHBtB0UuXn4mN-xwnC7tb=Cphjg@mail.gmail.com> <2a876340-e227-c96a-1d79-f8a74aa45e4a@gmail.com> <CAExg72eOp0cOmaptkO9B09yErd7hEKjxe=PVUcGqX5RoJ0jWKg@mail.gmail.com> <5ebe9fe2-3546-14f4-cd59-0b7335e26a40@gmail.com> <CAExg72f2xosd7iynrk3dYFjEnwDRSS2tiMt7FnaHfG2e2qrCuQ@mail.gmail.com> <6075918d-c07d-7a29-aecc-95e0b160033a@gmail.com> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox