riverqueue / riverqueue/riverui

JobCountByState query performance

Open
#106 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
236
Forks
39
Avg merge
3h 40m
Merged PRs (30d)
23

Description

Hey,

I'm really enjoying river so far, so thank you for that!

I was playing around with River UI, but on a table with just over 5 million jobs the queries become so slow that the api requests are timing out and I'm just getting a white screen (specifically the JobCountByState query). Haven't looked into it too much, so not sure if it's just missing an index somewhere.

This is happening both on my local M2 MacbookPro and on a small AlloyDB instance.

EDIT:

For some numbers, that query took 9s to complete on AlloyDB (which admittedly is under heavy use at the moment). The same query took just over 3s on my otherwise idle Macbook.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at api_handler.go around the linked JobCountByState query and reproduce its performance with a large jobs table. Inspect the query plan and existing indexes, then verify that the selected change makes the API request complete without timing out on a comparable dataset.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.