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 top option not working #65

Merged
merged 1 commit into from
Mar 23, 2024
Merged

Fix top option not working #65

merged 1 commit into from
Mar 23, 2024

Conversation

williamhCode
Copy link
Contributor

Fixes #62
Tested that using $top > 0 works now
I'm assuming .Page() should've been uncommented after the issue was fixed in .NET 6?

@haydenmc
Copy link
Member

Yes! Thank you! Will get this deployed to production shortly.

@haydenmc haydenmc merged commit 0fba4de into Purdue-io:main Mar 23, 2024
1 check passed
@haydenmc
Copy link
Member

This has been deployed to production. Apologies for the delay!

@williamhCode
Copy link
Contributor Author

No problem, thanks for the update!

haydenmc added a commit that referenced this pull request 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:
```sql
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.
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.

$top option doesn't work
2 participants