Fix SQLite filter used in River UI queue count pane - #1360
Merged
Conversation
brandur
force-pushed
the
brandur-fix-sqlite-filter
branch
from
August 23, 2026 12:30
bd5fe52 to
7870b1e
Compare
I noticed while testing SQLite out in the River UI that it's fairly slow when you click on the "queues" tab. This turns out to be because there was an accidental divergence in one of the SQLite queries in which it was omitting a filter that was present in the Postgres version. `JobCountByQueueAndStateResult` is used only in the queue pane of River UI and filters to `available` and `running`. Although omitting this filter may use the same index, there tends to be a massive quantity of `completed` rows that have to be counted unless that state is filtered out, which is why SQLite specifically was slow.
brandur
force-pushed
the
brandur-fix-sqlite-filter
branch
from
August 25, 2026 00:02
7870b1e to
704f1e8
Compare
bgentry
approved these changes
Aug 25, 2026
Contributor
Author
|
thx! If it's alright, I'm also going to cut a pair of new releases. I want to get this fix into River UI so I can double check that the SQLite version is just as performant (or similarly) as the Postgres version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed while testing SQLite out in the River UI that it's fairly slow
when you click on the "queues" tab. This turns out to be because there
was an accidental divergence in one of the SQLite queries in which it
was omitting a filter that was present in the Postgres version.
JobCountByQueueAndStateResultis used only in the queue pane of RiverUI and filters to
availableandrunning. Although omitting thisfilter may use the same index, there tends to be a massive quantity of
completedrows that have to be counted unless that state is filteredout, which is why SQLite specifically was slow.