我正在制作一个逐行读取文件并将记录插入数据库的应用程序。记录的数量大约是五十万。问题是整个过程大约需要两个小时。在Android上使用SQLite插入50万条记录
我能做些什么来加速这个过程?
public long insertTable(int id,String word) {
ContentValues wordValues = new ContentValues();
wordValues.put(COLUMN_D, id);
wordValues.put(COLUMN_WORD, word);
return this.sqliteDBInstance.insert(TABLE_ENGLISH, null, wordValues);
}
你好@Waqas请给出一些示例代码或链接来应用这种技术。 –
http://simonwdixon.wordpress.com/2011/08/16/android-sqllite-tip-1-wrap-batches-of-writes-in-a-transaction/ – waqaslam
http://notes.theorbis.net/ 2010/02/batch-insert-to-sqlite-on-android.html – waqaslam