Skip to content

Fix SQLite filter used in River UI queue count pane - #1360

Merged
brandur merged 1 commit into
masterfrom
brandur-fix-sqlite-filter
Aug 25, 2026
Merged

Fix SQLite filter used in River UI queue count pane#1360
brandur merged 1 commit into
masterfrom
brandur-fix-sqlite-filter

Conversation

@brandur

@brandur brandur commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

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
brandur force-pushed the brandur-fix-sqlite-filter branch from bd5fe52 to 7870b1e Compare August 23, 2026 12:30
@brandur
brandur requested a review from bgentry August 23, 2026 12:42
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
brandur force-pushed the brandur-fix-sqlite-filter branch from 7870b1e to 704f1e8 Compare August 25, 2026 00:02
@brandur

brandur commented Aug 25, 2026

Copy link
Copy Markdown
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.

@brandur
brandur merged commit 43b2b3c into master Aug 25, 2026
15 checks passed
@brandur
brandur deleted the brandur-fix-sqlite-filter branch August 25, 2026 01:13
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