Skip to content

Conversation

@MikeShi42
Copy link
Contributor

@MikeShi42 MikeShi42 commented Aug 30, 2025

Resolves HDX-1035

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2025

🦋 Changeset detected

Latest commit: dd4e2d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Minor
@hyperdx/api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview Comment Sep 3, 2025 3:18pm

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2025

Stably Runner - Test Suite - 'Smoke Test'

Test Suite Run Result: 🟢 Success (4/4 tests passed) [dashboard]


This comment was generated from stably-runner-action

@teeohhem teeohhem requested review from Copilot and teeohhem September 3, 2025 15:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a progressive time windowing strategy to improve search performance for long time range queries by chunking them into smaller incremental search windows (6h, 6h, 12h, 24h).

  • Refactors pagination to support time-windowed searches with progressive bucketing
  • Updates UI to display loading progress with current search date
  • Adds changeset documenting the feature enhancement

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/app/src/hooks/useOffsetPaginatedQuery.tsx Implements time windowing logic and updates pagination to work with windowed queries
packages/app/src/components/DBRowTable.tsx Adds loading date display to show search progress
.changeset/stale-brooms-sparkle.md Documents the feature change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

meta: data.pages[0].meta,
data: flattenPages(data.pages),
chSql: data.pages[0].chSql,
window: data.pages[data.pages.length - 1].window,
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the last page's window in flattenData may not represent the correct time window for the flattened data. Consider using the first page's window or creating a merged window that spans from the first to last page's time range.

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +103
if (window == null) {
throw new Error('Invalid time window for page param');
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is too generic. It should include the windowIndex value to help with debugging: Invalid time window for page param with windowIndex: ${pageParam.windowIndex}

Suggested change
if (window == null) {
throw new Error('Invalid time window for page param');
throw new Error(`Invalid time window for page param with windowIndex: ${pageParam.windowIndex}`);

Copilot uses AI. Check for mistakes.
@teeohhem
Copy link
Contributor

teeohhem commented Sep 3, 2025

Looks good in my limited testing. Code is clean too. I have a PR to add some unit tests, which I've written as a way to test this.

@kodiakhq kodiakhq bot merged commit 64eb638 into main Sep 3, 2025
7 of 8 checks passed
@kodiakhq kodiakhq bot deleted the mikeshi/window-large-time-range-searches branch September 3, 2025 15:17
@teeohhem
Copy link
Contributor

teeohhem commented Sep 3, 2025

tests pr #1132

kodiakhq bot pushed a commit that referenced this pull request Sep 17, 2025
Closes HDX-2407

This PR fixes searches which sort in ascending time order or do not order based on time. With this change, time-based "chunking" of queries (#1125) will only be used when the results are ordered by time. Further, when ordering by time _ascending_, the chunks will load in ascending time order (rather than descending time order).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants