Skip to content

added indexes to speed historical queries#320

Open
nanaabdul1172 wants to merge 1 commit into
StellarFlow-Network:mainfrom
nanaabdul1172:Database
Open

added indexes to speed historical queries#320
nanaabdul1172 wants to merge 1 commit into
StellarFlow-Network:mainfrom
nanaabdul1172:Database

Conversation

@nanaabdul1172
Copy link
Copy Markdown
Contributor

Closes #113

This change adds targeted indexes to speed up recent time-range and symbol-based historical queries: the schema at schema.prisma was updated to add @@index([updatedAt]) on PriceHistory, MultiSigPrice, Relayer, OhlcCandle, ComplianceMetadata, and PendingConsensus, and @@index([symbol]) plus @@index([updatedAt]) on Currency; these indexes optimize 7‑day chart and other recent-data lookups by enabling efficient filtering/sorting on updatedAt and quick symbol-based scans. Apply the DB changes locally with npx prisma migrate dev --name add-updatedAt-symbol-indexes (or npx prisma db push for a non-migration push), and create/run a proper migration in your production deployment pipeline.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@nanaabdul1172 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BACKEND] Database Indexing Optimization

1 participant