nevastx.blogg.se

Sqlite browser running slow
Sqlite browser running slow











sqlite browser running slow

The next logical step was to look for database optimisations and I started diving into the amazing world of SQLite. Secondly, I wanted the code to be simple and near to the daily usage version. The script I had written is very simple, so I assumed there isn’t much room for optimisation.

Sqlite browser running slow full#

Here is the full code SQLite Optimisations With this simple change, the running time was reduced to 10 minutes. I tried different sizes of batch inserts, found out 100,000 to be a sweet spot. Each transaction guarantees that it is written to disk thus could be slow. In SQLite, each insertion is atomic and is a transaction. This version took close to 15 minutes, sparked my curiosity and made me explore further to reduce the time. In this script, I tried to insert 10M rows, one by one, in a for loop. The standard library provides a nice SQLite module, using which I wrote my first version. Python is my go to language for any kind of scripting. No need of using true random methods, pseudo-random methods from stdlib are just fine.

sqlite browser running slow

  • It may use my machine resources to the fullest: 100% CPU, 8GB Memory and gigabytes of SSD space.
  • That is, it is fine if the process crashes and all the data is lost.
  • I don’t need the durability guarantee.
  • The machine I am using is MacBook Pro, 2019 (2.4 GHz Quad Core i5, 8GB, 256GB SSD, Big Sur 11.1)Īspects I was willing to compromise on were: The area column would hold six digits area code (any six digits would do, no validation). The generated data would be random with following constraints:













    Sqlite browser running slow