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

🐌 Fix performance regression causing Purdue.io front-end timeouts #67

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

haydenmc
Copy link
Member

@haydenmc haydenmc commented Apr 28, 2024

Recently the Purdue.io front-end started showing timeouts when browsing the Class list page for a particular Course.

Investigation revealed expensive SQL queries being generated, taking upwards of a minute to complete. Analysis revealed this section was contributing most of the cost of the query, requiring sequential evaluation of rows from disk:

SELECT t8."Id", t8."Email", t8."Name", t8."MeetingId", t8."InstructorId"
FROM (
	SELECT i."Id", i."Email", i."Name", m0."MeetingId", m0."InstructorId", ROW_NUMBER() OVER(PARTITION BY m0."MeetingId" ORDER BY i."Id") AS row
	FROM "MeetingInstructor" AS m0
	INNER JOIN "Instructors" AS i ON m0."InstructorId" = i."Id"
) AS t8
WHERE t8.row <= $7

Further investigation revealed that this was due to pagination logic being applied to the $expand operation. An issue is open with a similar repro here: OData/AspNetCoreOData#1041

The pagination logic was being applied due to the recent change #65. This PR reverts that change to fix the performance regression until a workaround is provided by the OData library.

@haydenmc haydenmc changed the title Fix performance issues affecting Purdue.io front-end 🐌 Fix performance regression causing Purdue.io front-end timeouts Apr 28, 2024
@haydenmc haydenmc merged commit dd6bfc7 into main Apr 28, 2024
1 check passed
@haydenmc haydenmc deleted the attempt-fix-perf branch April 28, 2024 21:51
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