tactical-retreat / dadguide-flutter

The DadGuide mobile app.
MIT License
0 stars 0 forks source link

Improve speed and safety of updates by using a transaction #191

Closed tactical-retreat closed 4 years ago

tactical-retreat commented 4 years ago

According to: https://www.sqlite.org/faq.html#q19

Each individual insert uses a transaction, which causes a lot of overhead.

By batching each table insert into one big insert, we can speed up the update time, particularly for large updates. It also eliminates any risk of an out of order update borking the table locally if one insert fails, although the data ordering is supposed to be oldest to newest tstamp.