Re: bulk DMLs - Mailing list pgsql-admin

From Gurjeet Singh
Subject Re: bulk DMLs
Date
Msg-id CABwTF4UTzcSCUv3KpYDwYTPzLTU2fQ5HuzLYBhUTy8GOHf4JqA@mail.gmail.com
Whole thread Raw
In response to Re: bulk DMLs  (Ron Johnson <ronljohnsonjr@gmail.com>)
List pgsql-admin
On Thu, Nov 16, 2023 at 8:21 AM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
>
> On Thu, Nov 16, 2023 at 7:04 AM Nikhil Ingale <niks.bgm@gmail.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



pgsql-admin by date:

Previous
From: Yee Yee ( 舒兰)
Date:
Subject: GSSAPI authentication on Redhat8 and PostgreSQL15/16
Next
From: Abdullah Ergin
Date:
Subject: Why did my PostgreSQL tables double in size?