pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ali . <mp.x@bk.ru>
To: "Godfrin, Philippe E" <philippe.godfrin@nov.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Gavin Roy <gavinr@aweber.com>
Subject:  Re: RE: [EXTERNAL] Re: Inserts and bad performance
Date: Tue, 30 Nov 2021 09:01:20 +0300
Message-ID: <1638252080.149803539@f520.i.mail.ru> (raw)
In-Reply-To: <SA0PR15MB3933644C28286B9BEC3B218C82619@SA0PR15MB3933.namprd15.prod.outlook.com>
References: <SA0PR15MB3933E7B425ADC5DC36D9A8CC82619@SA0PR15MB3933.namprd15.prod.outlook.com>
	<CAFVAjJEnQckKN8aLW=Oc8wDOB9+pKVJYhA_h3QxyYikzFMz-vg@mail.gmail.com>
	<SA0PR15MB3933644C28286B9BEC3B218C82619@SA0PR15MB3933.namprd15.prod.outlook.com>


Ok, thanks
--
Sent from Mail.ru app for Android Wednesday, 24 November 2021, 11:28pm +03:00 from Godfrin, Philippe E  philippe.godfrin@nov.com :

>The notion of COPY blocks and asynchronously is very interesting
> 
>From: Gavin Roy < gavinr@aweber.com>
>Sent: Wednesday, November 24, 2021 1:50 PM
>To: Godfrin, Philippe E < Philippe.Godfrin@nov.com>
>Cc: pgsql-general@lists.postgresql.org
>Subject: [EXTERNAL] Re: Inserts and bad performance
> 
> 
> 
> 
>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:
> 
>https://www.psycopg.org/psycopg3/docs/basic/copy.html#copy
> 
>And if using psycopg2, execute_batch might be of value:
> 
>https://www.psycopg.org/docs/extras.html?highlight=insert#psycopg2.extras.execute_batch
> 
>Regards,
> 
>Gavin
> 
> 

view thread (15+ messages)

Message-ID: <1638252080.149803539@f520.i.mail.ru>
Permalink:  ../1638252080.149803539@f520.i.mail.ru/
Also on:    postgresql.org/message-id/1638252080.149803539@f520.i.mail.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mp.x@bk.ru, philippe.godfrin@nov.com, gavinr@aweber.com
  Subject: Re: [EXTERNAL] Re: Inserts and bad performance
  In-Reply-To: <1638252080.149803539@f520.i.mail.ru>
  References: <SA0PR15MB3933E7B425ADC5DC36D9A8CC82619@SA0PR15MB3933.namprd15.prod.outlook.com> <CAFVAjJEnQckKN8aLW=Oc8wDOB9+pKVJYhA_h3QxyYikzFMz-vg@mail.gmail.com> <SA0PR15MB3933644C28286B9BEC3B218C82619@SA0PR15MB3933.namprd15.prod.outlook.com> <1638252080.149803539@f520.i.mail.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox