在 sqlite3 中更快的批量插入?

Faster bulk inserts in sqlite3?(在 sqlite3 中更快的批量插入?)
本文介绍了在 sqlite3 中更快的批量插入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含大约 30000 行数据的文件,我想加载到 sqlite3 数据库中.有没有比为每行数据生成插入语句更快的方法?

I have a file of about 30000 lines of data that I want to load into a sqlite3 database. Is there a faster way than generating insert statements for each line of data?

数据以空格分隔并直接映射到 sqlite3 表.是否有任何类型的批量插入方法可以将卷数据添加到数据库中?

The data is space-delimited and maps directly to an sqlite3 table. Is there any sort of bulk insert method for adding volume data to a database?

如果不是内置的,有没有人设计了一些非常棒的方法来做到这一点?

Has anyone devised some deviously wonderful way of doing this if it's not built in?

我应该先问一下,是否有 C++ 方法可以从 API 中做到这一点?

I should preface this by asking, is there a C++ way to do it from the API?

推荐答案

你也可以尝试调整一些参数 以获得额外的速度.具体来说,您可能想要 PRAGMA synchronous = OFF;.

You can also try tweaking a few parameters to get extra speed out of it. Specifically you probably want PRAGMA synchronous = OFF;.

这篇关于在 sqlite3 中更快的批量插入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
FastAPI + Tortoise ORM + FastAPI Users (Python) - Relationship - Many To Many(FastAPI+Tortoise ORM+FastAPI用户(Python)-关系-多对多)
Inserting NaN value into MySQL Database(将NaN值插入MySQL数据库)
How to get insertId for MySQL using Mysql2 in Node with async and pool?(如何在带异步和池的Node中使用Mysql2获取MySQL的InsertID?)
Window functions not working in pd.read_sql; Its shows error(窗口函数在pd.read_sql中不起作用;它显示错误)
(Closed) Leaflet.js: How I can Do Editing Geometry On Specific Object I Select Only?((已关闭)Leaflet.js:如何仅在我选择的特定对象上编辑几何图形?)