Re: [psycopg] speed concerns with executemany() - Mailing list psycopg

From Daniele Varrazzo
Subject Re: [psycopg] speed concerns with executemany()
Date
Msg-id CA+mi_8bdfAd5L4b7NURZ8uwsUwoVXwqh9qzbKKiPaiZdfo4FrA@mail.gmail.com
Whole thread Raw
In response to Re: [psycopg] speed concerns with executemany()  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: [psycopg] speed concerns with executemany()  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List psycopg
On Mon, Jan 2, 2017 at 4:46 PM, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
> On Mon, Jan 02, 2017 at 07:35:46AM -0800, Adrian Klaver wrote:
>
>>>> In [56]: %timeit -n 10 cur.executemany(sql, l)
>
> Someone along the way was asking for a possibility to "feed
> in" the 'l' values.
>
> Any chance 'l' can be supported to be a generator expression ?

The function would consume only page_size records at time. This is to
avoid creating a humongous query in memory and then on the server, but
has the nice effect of requesting only as many records from the
sequence.

-- Daniele


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: [psycopg] speed concerns with executemany()
Next
From: Adrian Klaver
Date:
Subject: Re: [psycopg] speed concerns with executemany()