- Use SQLite UPSERT for UpdateLiveRoute to eliminate SELECT+UPDATE/INSERT pattern - Add connection string optimizations (synchronous=NORMAL, cache_size) - Add WAL checkpoint configuration for better write performance - Add index on live_routes(id) for UPDATE operations - Set WAL autocheckpoint to 1000 pages These changes should reduce write amplification and improve overall throughput by: 1. Reducing from 2 queries to 1 for route updates 2. Better WAL checkpoint management 3. More efficient UPDATE operations with dedicated index |
||
---|---|---|
.. | ||
database.go | ||
interface.go | ||
models.go | ||
schema.sql | ||
slowquery.go | ||
utils.go |