Context
During the review of PR #1637, it was observed that compression_scheduler.py calls .commit() immediately after every .execute() statement. This pattern prevents batching of SQL statements and causes two issues:
- Loss of atomicity: Write-after-read operations may lose atomicity if commits occur between reads and writes, potentially allowing overwrites. Currently mitigated by having a single compression scheduler instance per deployment.
- Performance overhead: Frequent commits add overhead that hurts performance.
Goal
Investigate and implement a solution to reduce the frequency of .commit() calls in the compression scheduler, enabling better use of transactions and improving performance.
References