cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.85k stars 178 forks source link

Initialize the database inside a transaction #146

Closed SafariMonkey closed 3 years ago

SafariMonkey commented 3 years ago

I tried initializing mcfly on my ~1.5MB history file, and after leaving it for several minutes it hadn't finished initializing. Apparently, sqlite is known to be slow when inserting a lot of records outside of a transaction. As such, I tried adding a transaction around the operation, and sure enough, it initialized in a second or two.

cantino commented 3 years ago

Tested it and it seems to work. Nice trick!