Re: Inserts and bad performance - Mailing list pgsql-general

From Gavin Roy
Subject Re: Inserts and bad performance
Date
Msg-id CAFVAjJEnQckKN8aLW=Oc8wDOB9+pKVJYhA_h3QxyYikzFMz-vg@mail.gmail.com
Whole thread Raw
In response to Inserts and bad performance  ("Godfrin, Philippe E" <Philippe.Godfrin@nov.com>)
Responses RE: [EXTERNAL] Re: Inserts and bad performance
RE: [EXTERNAL] Re: Inserts and bad performance
List pgsql-general


On Wed, Nov 24, 2021 at 2:15 PM Godfrin, Philippe E <Philippe.Godfrin@nov.com> wrote:

Greetings

I am inserting a large number of rows, 5,10, 15 million. The python code commits every 5000 inserts. The table has partitioned children.


On the Python client side, if you're using psycopg, you should consider using using COPY instead of INSERT if you're not:


And if using psycopg2, execute_batch might be of value:


Regards,

Gavin

 

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inserts and bad performance
Next
From: "Godfrin, Philippe E"
Date:
Subject: RE: [EXTERNAL] Re: Inserts and bad performance