Reduce Snowflake profiler output size by decoupling query metrics from QUERY_TEXT#2567
Merged
Merged
Conversation
Keep exact QUERY_TYPE metrics in query_history, add a 10k-row query_samples table with SQL text for downstream heuristics, and drop unused user_activity login dumps that inflate high-volume extracts (#2532).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2567 +/- ##
=======================================
Coverage 70.35% 70.35%
=======================================
Files 107 107
Lines 9658 9658
Branches 1069 1069
=======================================
Hits 6795 6795
Misses 2655 2655
Partials 208 208 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
QUERY_TEXT
|
✅ 174/174 passed, 2 skipped, 1h40m13s total Running from acceptance #5084 |
m-abulazm
approved these changes
Jul 16, 2026
dgomez04
enabled auto-merge
July 16, 2026 14:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request addresses the massive Snowflake profiler extract sizes on high-volume accounts by decoupling metrics tracking from raw SQL text query history. We preserve high-value metrics while drastically reducing the bloat.
Key Changes
QUERY_TEXTfrom full-windowquery_history. Prevents multi-gigabyte SQL text extraction while keeping the exactQUERY_TYPEand performance metrics.query_samples. Extracts a random sample of up to 10,000 rows containingQUERY_TEXTandQUERY_ID(to join back toquery_historyfor downstream migration complexity analysis).user_activity. Removed theLOGIN_HISTORYdump, which is no longer used bylakebridge_profilersor GVP inputs and was contributing millions of rows of secondary bloat.Measured Impact
On a sample ~20M-row extract, omitting the raw SQL text yielded dramatic storage and network transfer savings:
Note. Workload spend-mix classification relies on
QUERY_TYPE, notQUERY_TEXT, meaning downstream classification accuracy remains unaffected.Follow-Ups
lakebridge-profilers'migration_complexity.sqlto read fromquery_samplesinstead ofquery_history.QUERY_TEXT.Tests
execute-database-profileron Snowflake staging/test accounts and verified:- [ ]
query_historyno longer containsquery_text- [ ]
query_samplesis limited to- [ ]
user_activitytable is completely gone.lakebridge-profilers(after changes) spend-mix path still functions correctly usingQUERY_TYPEfromquery_history.Closes #2532