-
Notifications
You must be signed in to change notification settings - Fork 73
Ignore statements that have no query id #840
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
Merged
+138
−10
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ REGRESS = basic \ | |
| version \ | ||
| guc \ | ||
| pgsm_query_id \ | ||
| query_id \ | ||
| functions \ | ||
| counters \ | ||
| relations \ | ||
|
|
||
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,79 @@ | ||
| CREATE EXTENSION pg_stat_monitor; | ||
| SET pg_stat_monitor.pgsm_track_utility = on; | ||
| SET pg_stat_monitor.pgsm_track_planning = on; | ||
| SET pg_stat_monitor.pgsm_normalized_query = on; | ||
| -- | ||
| -- Do not store queries without a query identifier | ||
| -- | ||
| SET compute_query_id = off; | ||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| t | ||
| --- | ||
| t | ||
| (1 row) | ||
|
|
||
| SELECT 1 AS no_query_id; | ||
| no_query_id | ||
| ------------- | ||
| 1 | ||
| (1 row) | ||
|
|
||
| CREATE TABLE no_query_id_tab (x int); | ||
| INSERT INTO no_query_id_tab VALUES (1); | ||
| SELECT x FROM no_query_id_tab; | ||
| x | ||
| --- | ||
| 1 | ||
| (1 row) | ||
|
|
||
| PREPARE no_query_id_prep AS SELECT x FROM no_query_id_tab WHERE x = $1; | ||
| EXECUTE no_query_id_prep(1); | ||
| x | ||
| --- | ||
| 1 | ||
| (1 row) | ||
|
|
||
| DEALLOCATE no_query_id_prep; | ||
| DROP TABLE no_query_id_tab; | ||
| DO $$ | ||
| BEGIN | ||
| PERFORM 1; | ||
| END | ||
| $$; | ||
| -- Nothing of the above was recorded. | ||
| SELECT count(*) FROM pg_stat_monitor; | ||
| count | ||
| ------- | ||
| 0 | ||
| (1 row) | ||
|
|
||
| -- | ||
| -- Tracking resumes once query identifiers are computed again. | ||
| -- | ||
| RESET compute_query_id; | ||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| t | ||
| --- | ||
| t | ||
| (1 row) | ||
|
|
||
| SELECT 1 AS with_query_id; | ||
| with_query_id | ||
| --------------- | ||
| 1 | ||
| (1 row) | ||
|
|
||
| SELECT calls, query FROM pg_stat_monitor | ||
| WHERE query LIKE '%with_query_id%' ORDER BY query COLLATE "C"; | ||
| calls | query | ||
| -------+---------------------------- | ||
| 1 | SELECT $1 AS with_query_id | ||
| (1 row) | ||
|
|
||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| t | ||
| --- | ||
| t | ||
| (1 row) | ||
|
|
||
| DROP EXTENSION pg_stat_monitor; |
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,37 @@ | ||
| CREATE EXTENSION pg_stat_monitor; | ||
| SET pg_stat_monitor.pgsm_track_utility = on; | ||
| SET pg_stat_monitor.pgsm_track_planning = on; | ||
| SET pg_stat_monitor.pgsm_normalized_query = on; | ||
|
|
||
| -- | ||
| -- Do not store queries without a query identifier | ||
| -- | ||
| SET compute_query_id = off; | ||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| SELECT 1 AS no_query_id; | ||
| CREATE TABLE no_query_id_tab (x int); | ||
| INSERT INTO no_query_id_tab VALUES (1); | ||
| SELECT x FROM no_query_id_tab; | ||
| PREPARE no_query_id_prep AS SELECT x FROM no_query_id_tab WHERE x = $1; | ||
| EXECUTE no_query_id_prep(1); | ||
| DEALLOCATE no_query_id_prep; | ||
| DROP TABLE no_query_id_tab; | ||
| DO $$ | ||
| BEGIN | ||
| PERFORM 1; | ||
| END | ||
| $$; | ||
| -- Nothing of the above was recorded. | ||
| SELECT count(*) FROM pg_stat_monitor; | ||
|
|
||
| -- | ||
| -- Tracking resumes once query identifiers are computed again. | ||
| -- | ||
| RESET compute_query_id; | ||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| SELECT 1 AS with_query_id; | ||
| SELECT calls, query FROM pg_stat_monitor | ||
| WHERE query LIKE '%with_query_id%' ORDER BY query COLLATE "C"; | ||
|
|
||
| SELECT pg_stat_monitor_reset() IS NOT NULL AS t; | ||
| DROP EXTENSION pg_stat_monitor; |
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.
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.