slow sqlite insert using the jdbc drivers in java

前端 未结 2 668
死守一世寂寞
死守一世寂寞 2021-01-11 14:26

I just inserted 1million records into a simple sqlite table with five columns. It took a whooping 18 hours in java using the jdbc drivers! I did the same thing in python2.5

2条回答
  •  無奈伤痛
    2021-01-11 15:05

    Did you have your queries autocommitted? That could explain why it took so long. Try wrapping them in a begin / end so that it doesn't have to do a full commit for every insert.

    This page explains begin/end transaction, while the FAQ touches on inserts/autocommits.

提交回复
热议问题