hyperdxio / hyperdxio/hyperdx

Partial Results in Paginated Search Invokes Repetitive Search

Open
#1,403 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Performance
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.