Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uf6VU-002AeV-ER for pgsql-general@arkaria.postgresql.org; Fri, 25 Jul 2025 00:41:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uf6VR-00Cvmz-Qn for pgsql-general@arkaria.postgresql.org; Fri, 25 Jul 2025 00:41:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uf6VR-00Cvmq-DQ for pgsql-general@lists.postgresql.org; Fri, 25 Jul 2025 00:41:49 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uf6VO-000gzq-1d for pgsql-general@postgresql.org; Fri, 25 Jul 2025 00:41:49 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-41cbc8da42aso871683b6e.2 for ; Thu, 24 Jul 2025 17:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753404105; x=1754008905; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=8Dg+vyvOHMAsoog/nft54f1oJt/aFadofnVEOGhq6V8=; b=DvfsNDl8pY7gEDMzDzFFqUIQZAxPQpRQ+zjkS6/cR6/EenE07K2fTjNtPaUM/UEQk5 XPjJ0w70RSqeROBHbaLkai8iTDKwSmnzJTRRGUjRga5ppb/ecnLZJ81ihZTUxaDU71J5 i9vQtqFujXEM+ZNSAA/Tpr0I5gC0VFWSCTtwONQ2zrXg9Bmdv3TYSFpL67bC1vp88oxp NTBuz7FdKnl2M4VfLY8XttIKb9j9qcGdWujTlbFHUYi5yskIIBU6CGLP1RQ8KEiPZjnv V4wIwJ801DTqhQ/NEnCxYL/XGIvrXQ9/DMlgAvKVf8c6U2QbpvU3vRwDnGV9nCo4MpBk 6w/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753404105; x=1754008905; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8Dg+vyvOHMAsoog/nft54f1oJt/aFadofnVEOGhq6V8=; b=fK2358CpDor9yDx1ASBL4GfXVRRzjmGV7ke1GcwGnlYrye4wXw9Jm0B8qwOXWKhB7y vpivZfuMuX+P/hldSf6pwwtuVYj7Bhv32M5AFkQRIYRA1oTQydkPG8xMZXOP98KfSrR5 xOcLuN8CAAeYi7rXsk7JEHT5ws9m768tK45zIa66wWHlG2v4leu+k/B4swmgLmM138yh eNEFJeM7xDTY4mwCDWLrOFjTgS0NCRDTFkOquDf0tUq4mj325yUMitw1FDGJG/rQuCau a3hGKeJBboKa+S0zNEdE4Gu6ejgV53XXnc9Q4+yMuPpX9hYMxta4VCxFfhm3FBda0LUD r0ew== X-Gm-Message-State: AOJu0YwHNUr6d3SBuY4kqUlffI3h/xcwz+fWg8di3+8sgsIc+mMRqopB vCGYAwDtwvE8lIidjRVZDJaQ7oNX1UuOQW7VRrbu6qIFbMPjJcZMeqHbk6/O8ijCMFjkBqi7jyD DUIBxFrDWOjja8MQ5C9bHH/kuTvZjhBdN8g== X-Gm-Gg: ASbGncspcs9p6Z/Pdr/zviLCifUXeMIMroGl93CsIW98De1Z7oczlHhUgPKdnMMQDvG 8yHblyvB9cHmXHLngN+4s8BFryz7p/m4KN1QxTBsLiYyO79rLE1I0m93YzsBBY5U9PRfQY8uqK8 AgN6W4FgP7M0rxh+4KW0LhxwG5cKUNLmh4D37bFNpjVFq2Dk8VxnHX7a7dFdKKD9MAGJ4qYSW22 /w+QtUZem1NovQGDdA= X-Google-Smtp-Source: AGHT+IFWQzpxHZyNXwzOf6Cn7t1Uk7H3KgGZ4R7KCKveC+YxcJAHGVCOueaQkzqiW1JBfAtj5PqnILnMyr+aliGKyQs= X-Received: by 2002:a05:6808:331a:b0:40c:f402:96f with SMTP id 5614622812f47-426c5a66c3dmr6200707b6e.14.1753404105320; Thu, 24 Jul 2025 17:41:45 -0700 (PDT) MIME-Version: 1.0 References: <1453510076.1900935.1753260637232.ref@mail.yahoo.com> <1453510076.1900935.1753260637232@mail.yahoo.com> <2129916799.2277829.1753359532611@mail.yahoo.com> <26359739.2491053.1753401573405@mail.yahoo.com> In-Reply-To: <26359739.2491053.1753401573405@mail.yahoo.com> From: Ron Johnson Date: Thu, 24 Jul 2025 20:41:34 -0400 X-Gm-Features: Ac12FXz4B9-7wKMV5VkJtIFEJRW3MrRs-AAVG3Ru0QFLkWqHX_j_hHGizTLnkY4 Message-ID: Subject: Re: Is there any limit on the number of rows to import using copy command To: Pgsql-general Content-Type: multipart/alternative; boundary="000000000000d86edd063ab6347e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d86edd063ab6347e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 24, 2025 at 8:00=E2=80=AFPM sivapostgres@yahoo.com < sivapostgres@yahoo.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 8642= 0 > 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. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000d86edd063ab6347e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jul 24, 2025 at 8:00=E2=80=AFPM <= a href=3D"mailto:sivapostgres@yahoo.com">sivapostgres@yahoo.com <sivapostgres@yahoo.com> wrote= :
[snip]=C2=A0
3.=C2=A0 Regarding movi= ng the logic to procedure.=C2=A0 Won't the trigger work?=C2=A0 Will it = be a burden for 86420 records?=C2=A0 It's working, if we insert few tho= usand records.=C2=A0 After split of trigger function, it's working for = 86420 records.=C2=A0 Are triggers overhead for handling even 100000 records= ?=C2=A0

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.=C2=A0 =C2=A0Of 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, t= hat will slow things down too: more indices means more work!
Thus= , drop as many indices as possible before loading data.


--
Death to <Redacted>, and but= ter sauce.
Don't boil me, I'm still alive.
<Red= acted> lobster!
--000000000000d86edd063ab6347e--