我有一个包含约 1.5 亿行表的数据库。这些列只是:
id (INTEGER), value_one (INTEGER), value_two (INTEGER), value_3 (INTEGER)
我需要将所有这些数据导入到 a中,但是我遇到了一个问题,即当我运行查询时QListQt 正在断言。我能够在包含约 700 万个条目的表上运行相同的代码,并且它可以正常工作。qAllocMore: 'Requested size is too large!', file tools\qbytearray.cpp, line 73SELECT
这是我的SELECT声明:
 bool e = query.exec("SELECT * FROM DocumentTerms");
 if (!e) {
     qWarning() << __FUNCTION__ << "\tError: " << query.lastError().text();
 }
 while (query.next()) {
     int docId = query.value(1).toInt();
     int termId = query.value(2).toInt();
     int frequency = query.value(3).toInt();
     //store it in a QHash<int, QPair<int, int>>
 }
看起来它正在遍历query.next循环,但断言在大约 1600 万次迭代后弹出。知道是什么原因造成的吗?