On 21.04.2013 05:15, 刘运杰 wrote:
Ok,I do not make my means clearly. I mean 60 seconds after my program 
started,not token 60 seconds to load database file.

Now, I got the reason of sqlite abnormal IO writing,it about batch insert.
Here is my usecase:
One table about 4 column and 500 row,the content of every row no exceed 100 
byte, every time I update the whole table using batch query.

It should take about one second and 100k IO writing on estimate,BUT it 
sustained about 20 second and wrote about 2.5M actually.


Now,I modify the implement of batch query, it take about one second and 70k IO 
writing.So there are abnormal something in batch query indeed,Sqlite or Qt SQL 
module.


Can you give a table schema ?

It's important to know what kind of primary key and indexes you define (if present). The amount of data written leads to the assumption that you are using a primary key not of type integer primary key and you have a few indexes perhaps to make searching faster.

If you have indexes and another primary key than integer primary key than you can improve the performance by delaying index creation until after a insert / update or by dropping a index before a bulk update and recreating the index afterwards. Otherwise each raw can lead to more than x page inserts updates.

Your scheme would be of help


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to