【问题标题】:sqlite: Import file that can not be stored in memorysqlite:导入文件不能存入内存
【发布时间】:2018-09-14 07:57:04
【问题描述】:

我有一个 72 Gb 的文件,我想将它放在数据库中,以便我可以分组。有没有办法将它放在 sqlite 数据库中?

我尝试了以下方法:

.mode csv
.separator ;
.import c:/location/of/file/file.csv tablename

在导入期间,我收到 内存不足 错误。

是否可以对如此大的文件使用 sqlite(其中一个只有 32 Gb 内存),还是我必须使用另一种类型的数据库?

【问题讨论】:

    标签: database sqlite csv import large-files


    【解决方案1】:

    在导入之前,请尝试以下语句:

    PRAGMA temp_store = 1;
    PRAGMA temp_store_directory = 'directory-name';
    

    temp_store = 1 用于将临时数据存储在文件中
    在 temp_store_directory 中,指定临时目录的路径,例如:C:/sqlitetemp

    【讨论】:

    • 谢谢,我会在今天晚些时候试一试,如果成功了再告诉你:)
    • 它仍然内存不足:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 2012-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多