Skip to content

perf: add prelimit CTE to getMapKeys query + store clickhouse settings in shared cache - #1201

Merged
kodiakhq[bot] merged 6 commits into
mainfrom
warren/fix-getKeyValues-regression
Sep 24, 2025
Merged

kodiakhq[bot] merged 6 commits into
mainfrom
warren/fix-getKeyValues-regression

Conversation

@wrn14897

@wrn14897 wrn14897 commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor

Optimize the query performance of the getMapKeys method to prevent excessive resource usage in ClickHouse, even when max_rows_to_read is specified.

Ref: HDX-2411
Ref: HDX-2431

I believe the reason Anthropic was hitting the memory error is that the `metadataMaxRowsToRead` setting was applied only to a specific query (and did not include the getKeyValues method). Now, since ClickHouse settings are cached and shared across all metadata instances, every method within the Metadata class should respect these settings.

This PR also adds another CTE filtering on top of queries that touch array aggregation functions like `groupUniqArray` and `groupUniqArrayArray`

I will port this fix to OSS later

Ref: HDX-2321
@changeset-bot

changeset-bot Bot commented Sep 23, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 38415a5

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

This PR includes changesets to release 3 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/app Patch
@hyperdx/api Patch

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

vercel Bot commented Sep 23, 2025 •

Copy link
Copy Markdown

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 23, 2025 10:00pm

@github-actions

github-actions Bot commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 21 passed • 3 skipped • 154s

Status Count
✅ Passed 21
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 3

View full report →

@wrn14897 wrn14897 changed the title fix: getKeyValues regression in pulling more values perf: add prelimit CTE to getMapKeys query + store clickhouse settings in shared cache Sep 23, 2025
@kodiakhq
kodiakhq Bot merged commit 8f06ce7 into main Sep 24, 2025
@kodiakhq
kodiakhq Bot deleted the warren/fix-getKeyValues-regression branch September 24, 2025 00:42
knudtty pushed a commit that referenced this pull request Apr 16, 2026
…s in shared cache (#1201)

Optimize the query performance of the getMapKeys method to prevent excessive resource usage in ClickHouse, even when max_rows_to_read is specified.

Ref: HDX-2411
Ref: HDX-2431

This branch was successfully deployed

1 active deployment
Preview — 38415a57 Deployed Sep 23, 2025 by vercel[bot]
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.

2 participants