Skip to content

Q: how does Connection.executemany work? #433

Closed

Description

@fried-sausage

In asyncpg (version 0.18.3), is this code:

for bind in bind_list:
    conn.execute("some insert query", *bind)

identical to this: conn.executemany("some insert query", bind_list)?
Because AFAIK this was/is the case with psycopg2.

Activity

  1. elprans commented on Apr 15, 2019

    @elprans
    Member

    It's not 100% identical, but close. Only the Bind/Execute part is actually inside the loop in the executemany case. All other query setup is done once.

    #295 reworks executemany to make it pipelined, which makes a big difference performance-wise.

  2. fried-sausage commented on Apr 19, 2019

    @fried-sausage
    Author

    thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions