epam / epam/epam-graphql

Connections should not use Skip(...)/Take(...), which are translated to OFFSET/LIMIT, for paging

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
enhancement investigation
Dominant language
C#
Stars
23
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Description

As for now, connections use Skip(...)/Take(...) for fetching particular page. It's not performant way for last pages - the further page from start the less performant a final query is.

### Describe the solution you'd like

Another approach for pagination is to use compound cursor consisting of id and (probably) other fields if additional sorting is applied.
Instead of sql `OFFSET`/`LIMIT` it should be translated to `WHERE Id > @id ORDER BY Id LIMIT @size` (or to `WHERE Name > @name AND Id > @id ORDER BY Name, Id LIMIT @size` with additional sorting by name field).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the connection pagination code that currently applies Skip(...)/Take(...), then trace how its SQL query and sorting are built. Done means replacing OFFSET/LIMIT paging with compound-cursor paging, including the additional sorting-field case described in the issue. The payload names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql, sql
Domain
api, backend-api-design, databases, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.