Re: bulk DMLs

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: bulk DMLs
Date: 2023-11-17 21:16:32
Message-ID: CABwTF4UTzcSCUv3KpYDwYTPzLTU2fQ5HuzLYBhUTy8GOHf4JqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Nov 16, 2023 at 8:21 AM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> On Thu, Nov 16, 2023 at 7:04 AM Nikhil Ingale <niks(dot)bgm(at)gmail(dot)com> wrote:
>>
>> Hi All,
>> Hope everyone is doing well.
>> I would like to know how we perform/handle the bulk provisioning i.e., insert/delete/updates in Postgresql.
>>
>
> Bulk loading via the COPY command is very efficient.
> Bulk deletes can be tricky. I'd use a CTE SELECT with LIMIT clause that fetches the PK in chunks.

TRUNCATE command is fast alternative to DELETE when you're sure you
want to delete all rows of a table. Please read the full docs of the
TRUNCATE command to make sure you understand the tradeoff, though.

https://www.postgresql.org/docs/current/sql-truncate.html

Best regards,
Gurjeet
http://Gurje.et

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Abdullah Ergin 2023-11-19 22:24:03 Why did my PostgreSQL tables double in size?
Previous Message 舒兰) <sweety.soul7@gmail.com> 2023-11-17 06:57:15 GSSAPI authentication on Redhat8 and PostgreSQL15/16