Re: speed concerns with executemany()

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: speed concerns with executemany()
Date: 2017-01-02 16:10:10
Message-ID: CA+mi_8bdfAd5L4b7NURZ8uwsUwoVXwqh9qzbKKiPaiZdfo4FrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Mon, Jan 2, 2017 at 4:46 PM, Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)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

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2017-01-02 16:15:54 Re: speed concerns with executemany()
Previous Message Daniele Varrazzo 2017-01-02 16:07:59 Re: speed concerns with executemany()