How Doist Optimizes GRDB in Todoist for iOS
Original post Optimizing GRDB in Todoist for iOS
Article Summary
The Todoist iOS team migrated from Realm to GRDB and immediately got flooded with complaints about sluggish performance. Their debugging journey uncovered a SQL trap that's probably lurking in your app too.
After switching Todoist's iOS local storage to GRDB, certain users experienced near-unusable performance during basic task operations. The culprit wasn't the framework itself but how associated values were being fetched. This deep dive walks through 40+ profiling sessions to find the root cause.
Key Takeaways
- LEFT JOINs with multiple associations created 600,000 intermediate rows for just 330 records
- Switching to subqueries delivered 90-99% speed improvement in performance tests
- Projects with many tasks AND completed tasks AND comments hit the worst case
- Low Power Mode on newer iPhones reproduced issues invisible on normal devices
A single project with 200 tasks, 100 completed tasks, and 30 comments was generating 600,000 intermediate SQL rows when it only needed to process 331.
Continue reading
This page summarizes “Optimizing GRDB in Todoist for iOS” by Doist, published Jan 27, 2026. All credit for the original work goes to the authors.