Skip to content

add index for query leaderboard ranking#451

Merged
yangw-dev merged 4 commits intomainfrom
addindex
Feb 26, 2026
Merged

add index for query leaderboard ranking#451
yangw-dev merged 4 commits intomainfrom
addindex

Conversation

@yangw-dev
Copy link
Collaborator

@yangw-dev yangw-dev commented Feb 26, 2026

Overview

add index for fast leaderboard query for active ranking.
This should works well with query https://github.com/gpu-mode/kernelboard/blob/main/kernelboard/api/leaderboard_summaries.py#L63

partial idx for runs

Notice we have partial idx for runs, it still works for additional condition
Adding MORE conditions → Partial index still works

-- Original partial index
WHERE NOT secret AND score IS NOT NULL AND passed

--  new query adds 'AND active' for instance
WHERE NOT secret AND score IS NOT NULL AND passed AND active

But it won't works for less partial index

-- Original partial index
WHERE NOT secret AND score IS NOT NULL AND passed

-- Your new query removes 'AND passed'
WHERE NOT secret AND score IS NOT NULL

for rankings, we always query as WHERE NOT secret AND score IS NOT NULL AND passed. Make this specific can make things faster that non-partial one

@yangw-dev yangw-dev requested a review from msaroufim February 26, 2026 20:13
@yangw-dev yangw-dev changed the title add index for query add index for query leaderboard ranking Feb 26, 2026
Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright let's try this out - you'll still need to update things using the northflank url - feel free to message on kernelbot channel for credentials if you can't find them in the UI but you want the prod public URL and admin username and password

Unit test in CI is failing with some DB error though

@yangw-dev
Copy link
Collaborator Author

seems like it does not like concurrently
in that case, we can create without concurrently, but to not block submission, i will run this tonight @msaroufim

@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/libkernelbot
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

@yangw-dev yangw-dev marked this pull request as ready for review February 26, 2026 20:48
@yangw-dev yangw-dev merged commit a0e0094 into main Feb 26, 2026
5 checks passed
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