Skip to content

Optimize reward-amounts query for postgres'#3819

Merged
imabdulbasit merged 6 commits intomainfrom
ab/reward-amounts-query-idx
Dec 4, 2025
Merged

Optimize reward-amounts query for postgres'#3819
imabdulbasit merged 6 commits intomainfrom
ab/reward-amounts-query-idx

Conversation

@imabdulbasit
Copy link
Copy Markdown
Contributor

@imabdulbasit imabdulbasit commented Dec 3, 2025

Optimizes get_all_reward_accounts query by using DISTINCT ON instead of ROW_NUMBER() for postgres, and by adding an index on (idx, created)

@imabdulbasit imabdulbasit marked this pull request as draft December 3, 2025 18:08
@imabdulbasit imabdulbasit marked this pull request as ready for review December 3, 2025 18:36
@imabdulbasit imabdulbasit changed the title add index for reward-amounts query Optimize reward-amounts query for postgres' Dec 3, 2025
Comment thread sequencer/src/api/sql.rs
@imabdulbasit imabdulbasit enabled auto-merge (squash) December 4, 2025 02:53
@imabdulbasit imabdulbasit disabled auto-merge December 4, 2025 02:53
@imabdulbasit imabdulbasit merged commit d0658d3 into main Dec 4, 2025
112 of 116 checks passed
@imabdulbasit imabdulbasit deleted the ab/reward-amounts-query-idx branch December 4, 2025 02:54
imabdulbasit added a commit that referenced this pull request Dec 4, 2025
* add index for reward-amounts query

* remove where

* include entry

* change query

* created desc for sqlite

* fix tests
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.

2 participants