Can SQLite handle 90 million records?

前端 未结 8 2238
故里飘歌
故里飘歌 2020-12-04 10:50

Or should I use a different hammer to fix this problem.

I\'ve got a very simple use-case for storing data, effectively a sparse matrix, which I\'ve attempted to stor

8条回答
  •  生来不讨喜
    2020-12-04 11:37

    Answering my own question just as a place to put some details:

    It turns out (as correctly suggested above) that the index creation is the slow step, and every time I do another transaction of inserts, the index is updated which takes some time. My solution is to: (A) create the data table (B) insert all my historical data (several years worth) (C) create the indexes

    Now all lookups etc are really fast and sqlite does a great job. Subsequent daily updates now take a few seconds to insert only 800 records, but that is no problem since it only runs every 10 minutes or so.

    Thanks to Robert Harvey and maxwellb for the help/suggestions/answers above.

提交回复
热议问题