This repository was archived by the owner on Jun 19, 2026. It is now read-only.
feat: Database indexing optimization for financial queries - #1061
Open
oldke766 wants to merge 1 commit into
Open
feat: Database indexing optimization for financial queries#1061oldke766 wants to merge 1 commit into
oldke766 wants to merge 1 commit into
Conversation
…dash08#128) Implements composite indexes targeting the most frequent query patterns: Expense table (primary workhorse): - ix_expenses_user_type_spent: dashboard monthly income/expense aggregation - ix_expenses_user_category: category breakdown queries - ix_expenses_user_date_amount: duplicate detection lookups - ix_expenses_user_recurring_date: recurring expense generation checks Other tables: - ix_categories_user_id/name: category listing and uniqueness - ix_recurring_user_active: active recurring expense listing - ix_bills_user_active_due: upcoming bills dashboard query - ix_reminders_sent_send_at: pending reminders scheduler - ix_ad_impressions_created: time-range analytics - ix_user_subscriptions_user_active: active plan lookup - ix_audit_logs_user_id/created_at: audit trail queries Includes: - SQLAlchemy model index definitions - SQL migration script (idempotent CREATE INDEX IF NOT EXISTS) - schema.sql updates for fresh deployments - 11 test cases verifying index existence and column coverage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Database Indexing Optimization for Financial Queries
Closes #128
Summary
Adds composite database indexes targeting the most frequent query patterns in the FinMind application, significantly improving performance for dashboard summaries, expense listing, recurring expense generation, and duplicate detection.
Changes
SQLAlchemy Model Indexes ()
SQL Migration ()
Schema Update ()
Testing
Performance Impact
Checklist