Partial Results in Paginated Search Invokes Repetitive Search
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Description
[Needs Validation]
For a given search over a windowed time range (ex. over several days) and if there are only a few results in a given window (ex. 3 rows), we dispatch an extra extraneous SELECT .. LIMIT 200 OFFSET 3 query, even though we know if the last result length is less than limit, we can move onto the next window.
This can increase pagination latency.
We probably need to improve the conditional check here to compare the last page result count with the LIMIT we requested before going to the next offset: https://github.com/hyperdxio/hyperdx/blob/a9f10c5ff97c20b67491293ccd823901ffb11a23/packages/app/src/hooks/useOffsetPaginatedQuery.tsx#L104
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/app/src/hooks/useOffsetPaginatedQuery.tsx at line 104 and inspect the conditional that dispatches the next offset query. Validate the behavior with a search spanning multiple time windows and confirm that a result page shorter than the requested limit advances to the next window without issuing an unnecessary query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100