Skip to content

Speed up bulk insert #2290

Answered by elprans
Mulugruntz asked this question in Q&A
Mar 1, 2021 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

How to make it faster? Currently the average speed is about 2300 records/second.

We'll implement batched executemany soon a-la asyncpg, so this'll be much faster.

Meanwhile, the best way is to open a bunch of concurrent connections and chunk data in. Example: https://github.com/edgedb/webapp-bench/blob/366a9a74f59442cf279b02ab482d4ff48c6b5b2b/_edgedb/loaddata.py

How to estimate the size in DB? (knowing there's an index)

Do you mean the actual size in megabytes or the number of records in an object set?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Mulugruntz
Comment options

Answer selected by Mulugruntz
Comment options

You must be logged in to vote
2 replies
@Mulugruntz
Comment options

@thedeadliestcatch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants