-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Bulk loading #311
Comments
Hey, did you ever finish the page for bulk inserts? I'm having very poor performance inserting bulk data with |
http://docs.peewee-orm.com/en/latest/peewee/querying.html#bulk-inserts What database? Poor compared to what? |
I'm using a sqlite database. Even for a relatively simple insert of about 2000 rows of 5 ints (per row) it takes about 5 seconds for peewee to insert. |
I upgraded my sqlite version. Before I was only able to insert about 200 rows per transaction due to that version of sqlite's SQLITE_MAX_VARIABLE_NUMBER. I can now insert over 40,000 rows in one |
I'm really sorry to bother you, @coleifer , but I have one more question. Based on what I've been reading, it seems that for doing large bulk inserts it's better to insert the data into a table without an index and then build the index for the table later. Is this possible to do with peewee? If this isn't the correct place for this question let me know and I'll post it elsewhere. I wasn't able to find anything on SO regarding the topic for peewee. |
There's a great StackOverflow thread on speeding up SQLite inserts. Summary of tips:
For peewee, you can create the tables and indexes separately by running: db = SqliteDatabase(...)
db.create_table(ModelClass)
db.create_table(Model2)
# do insert
ModelClass.create_indexes()
Model2.create_indexes() |
Sorry to get back to you so late, I didn't see this email. Thanks for the On Mon, May 30, 2016 at 6:35 PM, Charles Leifer notifications@github.com
|
Bulk loading performance improvements, see Maxime's post on mailing list.
The text was updated successfully, but these errors were encountered: