Here's what I did to achieve this performance boost.
I was implementing cursor pagination with EF and Postgres.
But I need to make the query faster.
How do you make an SQL query faster?
Add an index, and you're good to go.
Right?
Not quite...
I created a composite index on the required columns to speed up the query.
BUT THIS MADE THE QUERY SLOWER!!!
This led me down a rabbit hole to figure out why the index wasn't used.
I knew about tuple comparison from before, and this solved the problem.
But I didn't know how to translate this into an EF Core query.
Luckily, the Postgres provider supports this with a custom function.
Here's everything you should know: https://lnkd.in/eD629U-B
---
Sign up for the .NET Weekly with 74K+ other engineers, and get a free Clean Architecture template: https://lnkd.in/e-XH7dM7