Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: how does Connection.executemany work? #433

Closed
fried-sausage opened this issue Apr 15, 2019 · 2 comments
Closed

Q: how does Connection.executemany work? #433

fried-sausage opened this issue Apr 15, 2019 · 2 comments

Comments

@fried-sausage
Copy link

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.

@elprans
Copy link
Member

elprans commented Apr 15, 2019

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.

@fried-sausage
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants