-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(postgres,comlink): Improve historical-pnl/parentSubaccount
query
#2764
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces support for handling parent subaccounts in query operations. It adds a new parameter, Changes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
historical-pnl/parentSubaccount
query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
indexer/packages/postgres/src/types/subaccount-types.ts (1)
26-29
: Clean interface addition for parent subaccount support.The new
ParentSubaccount
interface is well-structured and focused, containing just the necessary fields to identify a parent subaccount. It aligns with the PR objective of optimizing the historical PnL queries by using parent subaccount information instead of passing all child subaccount IDs.Consider adding a JSDoc comment explaining the purpose of this interface and how it relates to the query optimization:
+/** + * Interface representing a parent subaccount identifier. + * Used for querying child subaccounts in historical PnL queries + * instead of passing all possible childSubaccountIds. + */ export interface ParentSubaccount { address: string, subaccountNumber: number, }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
indexer/packages/postgres/src/types/query-types.ts
(3 hunks)indexer/packages/postgres/src/types/subaccount-types.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- indexer/packages/postgres/src/types/query-types.ts
⏰ Context from checks skipped due to timeout of 90000ms (13)
- GitHub Check: test / run_command
- GitHub Check: call-build-ecs-service-vulcan / (vulcan) Check docker image build
- GitHub Check: call-build-ecs-service-socks / (socks) Check docker image build
- GitHub Check: call-build-ecs-service-roundtable / (roundtable) Check docker image build
- GitHub Check: call-build-ecs-service-ender / (ender) Check docker image build
- GitHub Check: call-build-ecs-service-comlink / (comlink) Check docker image build
- GitHub Check: check-build-bazooka
- GitHub Check: check-build-auxo
- GitHub Check: lint
- GitHub Check: run_command
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: Summary
Changelist
Instead of passing in all possible
childSubaccountid
intofindAll
, add a subquery that retrieves existing subaccounts.Test Plan
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit