β‘ Bolt: Add database index for sourceBundleId#3
Conversation
π‘ What: Added a new SQLite index `idx_items_sourceBundleId` on the `items` table. Updated schema version to 2 and added migration logic to apply the index to existing databases. Updated initial schema creation to include the index for new installations. π― Why: The application frequently filters items by `sourceBundleId` (e.g., in `getUniqueApps()` and `fetchForExport(bundleIds:)`). Without an index, these queries perform a full table scan, which degrades performance as the history grows (up to 50,000 items). π Impact: - Transforms O(n) table scans into O(log n) index lookups for app-based filtering. - Significantly speeds up the "Selected Apps" export workflow and the population of the app filter list in Settings. - Reduces database I/O for these operations. π¬ Measurement: - Verify that `PRAGMA user_version` is 2 after launch. - Verify that `EXPLAIN QUERY PLAN SELECT ... WHERE sourceBundleId = ...` uses the new index.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Added database index for
sourceBundleIdto improve performance of app-based filtering and exports.PR created automatically by Jules for task 7216602016479896066 started by @kiku-jw