Re: Is there any limit on the number of rows to import using copy command

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there any limit on the number of rows to import using copy command
Date: 2025-07-25 00:41:34
Message-ID: CANzqJaDvu68fYz1tADA8=Gb=UV7asUYeyio6UnkcSgtr=F7uUQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jul 24, 2025 at 8:00 PM sivapostgres(at)yahoo(dot)com <
sivapostgres(at)yahoo(dot)com> wrote:
[snip]

> 3. Regarding moving the logic to procedure. Won't the trigger work?
> Will it be a burden for 86420 records? It's working, if we insert few
> thousand records. After split of trigger function, it's working for 86420
> records. Are triggers overhead for handling even 100000 records?
>

What causes the overhead when a trigger fires is all the work that it has
to do.

Thus, if the SELECT or UPDATE statements in the triggers do not have good
index support, then _that_ is what will slow down the trigger as the number
of records gets bigger. Of course, the triggers are not slow, it's the
statements in the trigger that are slow.

Likewise, if there are many many indices on the tables, that will slow
things down too: more indices means more work!
Thus, drop as many indices as possible before loading data.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-07-25 00:48:53 Re: Is there any limit on the number of rows to import using copy command
Previous Message sivapostgres@yahoo.com 2025-07-24 23:59:33 Re: Is there any limit on the number of rows to import using copy command