Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS Apps - SQL improvements for better performance #5122

Open
jr-air opened this issue May 28, 2024 · 0 comments
Open

IOS Apps - SQL improvements for better performance #5122

jr-air opened this issue May 28, 2024 · 0 comments

Comments

@jr-air
Copy link

jr-air commented May 28, 2024

Summary

For the IOS Apps, on initial load they are slow to open especially on the "Popular TV" section. (MySql database in use)

  1. Multiple queries are performed multiple times against services not enabled in OMBI. For example, If only Plex is enables, multiple queries are still performed against Emby and Jellyfin tables. Maybe an initial check on the enablement status can be done to suppress future queries?

  2. For Popular TV, there are hundreds of "individual" queries performed, matching each Season and Episode pair. Ideally if possible, performing a bulk query loaded into an array that can then be processed in the app should allow for a significant performance boost?

Ombi Version

4.43.5

What platform(s) does this occur on?

Docker

What database are you using?

MySQL

Relevant log output

For item #2 above, this query is executed for each and every Season/Episode pair. For a TV series with 20 Seasons, and 20 Episodes per season, this equals 400 individual queries just for this one show... 

SELECT `p`.`Id`, `p`.`EpisodeNumber`, `p`.`GrandparentKey`, `p`.`Key`, `p`.`ParentKey`, `p`.`SeasonNumber`, `p`.`Title`, `p0`.`Id`, `p0`.`AddedAt`, `p0`.`Has4K`, `p0`.`ImdbId`, `p0`.`Key`, `p0`.`Quality`, `p0`.`ReleaseYear`, `p0`.`RequestId`, `p0`.`TheMovieDbId`, `p0`.`Title`, `p0`.`TvDbId`, `p0`.`Type`, `p0`.`Url`
FROM `PlexEpisode` AS `p`
LEFT JOIN `PlexServerContent` AS `p0` ON `p`.`GrandparentKey` = `p0`.`Key`
WHERE ((`p`.`EpisodeNumber` = 13) AND (`p`.`SeasonNumber` = 3)) AND (`p0`.`TheMovieDbId` = '2734')
LIMIT 1
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

No branches or pull requests

1 participant