perf(db): add composite indexes for high-frequency financial queries#780
Open
bkennedyshit wants to merge 1 commit intorohitdash08:mainfrom
Open
perf(db): add composite indexes for high-frequency financial queries#780bkennedyshit wants to merge 1 commit intorohitdash08:mainfrom
bkennedyshit wants to merge 1 commit intorohitdash08:mainfrom
Conversation
…ohitdash08#128) - ix_expenses_user_spent: covers dashboard date-range aggregations - ix_expenses_user_category: covers category breakdown queries - ix_expenses_user_type: covers income vs expense splits - ix_recurring_user_active: covers active recurring expense fetches - ix_bills_user_due: covers upcoming bills lookups - ix_categories_user: covers per-user category list queries Includes Alembic migration (003_add_performance_indexes) and model-level Index() definitions for ORM awareness. Tests verify index presence and query smoke tests pass.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #128
What
Adds 6 composite SQLAlchemy indexes targeting the most common query patterns in FinMind's financial data layer.
Indexes Added
ix_expenses_user_spentix_expenses_user_categoryix_expenses_user_typeix_recurring_user_activeix_bills_user_dueix_categories_userImplementation
003_add_performance_indexes.pywithupgrade()anddowngrade()models_indexed.py— ORM-levelIndex()definitions for SQLAlchemy awarenessTesting