Skip to content

get_index query rewrite#70

Open
dankmeme01 wants to merge 3 commits into
mainfrom
kill-giga-query
Open

get_index query rewrite#70
dankmeme01 wants to merge 3 commits into
mainfrom
kill-giga-query

Conversation

@dankmeme01
Copy link
Copy Markdown
Member

@dankmeme01 dankmeme01 commented Jun 1, 2026

This PR rewrites the SQL query in Mod::get_index to no longer be a large, monolithic query and instead adds joins and filters as they are needed. Additionally, it fixes potential logic holes in the query design. For example, previously, when requesting gd=2.208&geode=5.7.0 mods it could return mods running Geode v5.0.0-alpha.1, which Geode would refuse to load. The new query will not return those mods. This is hopefully the only change to behavior observable from the outside.

I ran a small stress test script that overwhelmed the server with requests to see how fast it can process them all, using a mix of typical queries (latest GD/Geode versions, random platform, everything else unset) and completely random queries to compare the performance, and with this PR the response times seem to be ~7.5 times faster. This should hopefully reduce the strain on the database by a ton

Also added some indexes, idk if completely correct but should be an improvement

@dankmeme01 dankmeme01 marked this pull request as draft June 1, 2026 11:22
@dankmeme01 dankmeme01 marked this pull request as ready for review June 1, 2026 13:24
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.

1 participant