-
-
Notifications
You must be signed in to change notification settings - Fork 831
API for inserting multiple rows fast #2
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
Comments
? |
This is a feature request. The feature would provide an API for batching large amounts of rows from JS to C++ land. The idea is to improve performance. However, we haven't found any performance bottlenecks in this area for our use case, so it's not implemented yet. |
a-ha! |
This is a must have. Well established DB-APIs all have some way to batch insert values. See Python's executemany. http://www.python.org/dev/peps/pep-0249/#id18 . |
I recommend adding following. It has speed up inserting in order of magnitude. Source: http://blog.quibb.org/2010/08/fast-bulk-inserts-into-sqlite/ db.run('PRAGMA synchronous=OFF')
db.run('PRAGMA count_changes=OFF')
db.run('PRAGMA journal_mode=MEMORY')
db.run('PRAGMA temp_store=MEMORY') |
What RobertSasak said plus begin/commit. I get ~ 30K rows/sec. |
* Fixed testing on linux, readme, electron test marshal.node failed to link on linux for marshal-test.js specified library in test/cpp/binding.gyp Electron test only worked if repo was checked out as exactly node-sqlite3 also, module was sometimes cached, breaking the test (needed to delete it to force reload)
I like the PRAGMA suggestions in this thread, so I don't think we explicitly need a specific API right now 🙂 |
No description provided.
The text was updated successfully, but these errors were encountered: