-
Notifications
You must be signed in to change notification settings - Fork 4
feat: emit parent_query_id to link nested SPI queries #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoshDreamland
wants to merge
10
commits into
main
Choose a base branch
from
parent-query-id-surgical
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6a7062c
feat: emit parent_query_id to link nested SPI queries
JoshDreamland 16510f4
style: re-align identity-block trailing comments
JoshDreamland b9f4e7d
fix: use Int64 for parent_query_id, guard NULL-frame skew
JoshDreamland 98ca62f
test: TAP test for parent_query_id linkage and log-event off-by-one
JoshDreamland b82cc74
fix: bind nesting_level to frame push/pop; store parent in frame
JoshDreamland 534abc9
fix: extend Start's PG_TRY to cover InstrAlloc
JoshDreamland 92edd0c
refactor: use nesting_level = -1 as the no-frame resting state
JoshDreamland c632cdc
fix: surface depth-cap overflow and default start_ts to now
JoshDreamland 28e079e
fix(arrow): ship parent_query_id in the Arrow IPC schema
JoshDreamland f52d76c
test: add t/029 for the Arrow/OTel path; keep t/028 on ClickHouse
JoshDreamland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| -- Migration: add parent_query_id column | ||
| -- | ||
| -- Introduced in pg_stat_ch 0.4.x. Each event now carries the query_id of its | ||
| -- calling query (e.g. the plpgsql function that issued an SPI statement). | ||
| -- Top-level queries emit 0. Use WHERE parent_query_id = 0 in aggregations to | ||
| -- avoid double-counting CPU and duration across nested calls. | ||
| -- | ||
| -- Run against your ClickHouse instance before upgrading the extension: | ||
| -- clickhouse-client < migrations/001_add_parent_query_id.sql | ||
|
|
||
| ALTER TABLE pg_stat_ch.events_raw | ||
| ADD COLUMN IF NOT EXISTS parent_query_id Int64 DEFAULT 0; |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.