softwareconstruction240 / autograder

Autograder for BYU's CS 240 Chess project
https://cs240.click
2 stars 2 forks source link

filter with index before sorting #327

Closed pawlh closed 2 months ago

pawlh commented 2 months ago

What this does

This PR revises the query that fetches the latest submission for each student-phase. Arguably we don't need this feature anymore, but given that it is still present I wanted to patch our memory overflow error:

ERROR 1038 (HY001): Out of sort memory, consider increasing server sort buffer size

I tried a lot of different ways to get the query to fallback on indexes, but the conclusion of my research was that indexes are hard.

This PR modifies the query to filter out all the submissions we don't care about before sorting. This technically doesn't fix the problem and mostly just moves the issue further down, but I'd be pretty surprised if we encounter it again, especially if intend on clearing the database each semester