Skip to content

fix: Add index on id/language on subtitle table - #1918

Merged
joschahenningsen merged 1 commit into
devfrom
fix/add-index-on-subtitle-stream-lang
Aug 10, 2026
Merged

fix: Add index on id/language on subtitle table#1918
joschahenningsen merged 1 commit into
devfrom
fix/add-index-on-subtitle-stream-lang

Conversation

@joschahenningsen

Copy link
Copy Markdown
Member

we're seeing logs like this in prod:

2026-08-09 17:12:25.210 unk 2026/08/09 17:12:25 WARN slow sql query [11.613233922s >= 500ms] slow_query=true query="SELECT * FROM `stats` WHERE (live = 0 AND time BETWEEN '2026-08-09 17:00:00' and '2026-08-09 18:00:00') AND `stats`.`deleted_at` IS NULL ORDER BY `stats`.`id` LIMIT 1" duration=11.613233922s rows=1 file=/go/src/app/dao/streams.go:124 

The subtitle table is giant, but we only ever query by id and language. This adds an index on those.

@joschahenningsen joschahenningsen self-assigned this Aug 9, 2026
@joschahenningsen joschahenningsen added the bug Something isn't working label Aug 9, 2026
@joschahenningsen
joschahenningsen merged commit da7f8f7 into dev Aug 10, 2026
8 checks passed
@joschahenningsen
joschahenningsen deleted the fix/add-index-on-subtitle-stream-lang branch August 10, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants