forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge with yb::master up to commit 6d92aa6
- Loading branch information
Showing
62 changed files
with
1,756 additions
and
799 deletions.
There are no files selected for viewing
This file contains 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 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
51 changes: 51 additions & 0 deletions
51
src/postgres/contrib/pg_stat_statements/pg_stat_statements--1.6--1.6-yb-1.0.sql
This file contains 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,51 @@ | ||
/* contrib/pg_stat_statements/pg_stat_statements--1.6--1.6-yb-1.0.sql */ | ||
|
||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION pg_stat_statements UPDATE TO '1.6-yb-1.0'" to load this file. \quit | ||
|
||
/* First we have to remove them from the extension */ | ||
ALTER EXTENSION pg_stat_statements DROP VIEW pg_stat_statements; | ||
ALTER EXTENSION pg_stat_statements DROP FUNCTION pg_stat_statements(boolean); | ||
|
||
/* Then we can drop them */ | ||
DROP VIEW IF EXISTS pg_stat_statements; | ||
DROP FUNCTION IF EXISTS pg_stat_statements(boolean); | ||
|
||
-- Update the view pg_stat_statements. | ||
-- Register functions. | ||
|
||
CREATE OR REPLACE FUNCTION pg_stat_statements(IN showtext boolean, | ||
OUT userid oid, | ||
OUT dbid oid, | ||
OUT queryid bigint, | ||
OUT query text, | ||
OUT calls int8, | ||
OUT total_time float8, | ||
OUT min_time float8, | ||
OUT max_time float8, | ||
OUT mean_time float8, | ||
OUT stddev_time float8, | ||
OUT rows int8, | ||
OUT shared_blks_hit int8, | ||
OUT shared_blks_read int8, | ||
OUT shared_blks_dirtied int8, | ||
OUT shared_blks_written int8, | ||
OUT local_blks_hit int8, | ||
OUT local_blks_read int8, | ||
OUT local_blks_dirtied int8, | ||
OUT local_blks_written int8, | ||
OUT temp_blks_read int8, | ||
OUT temp_blks_written int8, | ||
OUT blk_read_time float8, | ||
OUT blk_write_time float8, | ||
OUT yb_latency_histogram jsonb | ||
) | ||
RETURNS SETOF record | ||
AS 'MODULE_PATHNAME', 'yb_pg_stat_statements_1_4' | ||
LANGUAGE C STRICT VOLATILE PARALLEL SAFE; | ||
|
||
-- Register a view on the function for ease of use. | ||
CREATE OR REPLACE VIEW pg_stat_statements AS | ||
SELECT * FROM pg_stat_statements(true); | ||
|
||
GRANT SELECT ON pg_stat_statements TO PUBLIC; |
Oops, something went wrong.