diff --git a/src/common/backend/catalog/system_views.sql b/src/common/backend/catalog/system_views.sql index b60f2bd17..290595349 100644 --- a/src/common/backend/catalog/system_views.sql +++ b/src/common/backend/catalog/system_views.sql @@ -1080,7 +1080,7 @@ SELECT S.node_group, T.top_cpu_dn FROM pg_stat_activity_ng AS S, pg_stat_get_wlm_realtime_session_info(NULL) AS T -WHERE S.pid = T.threadid; +WHERE S.sessionid = T.threadid; CREATE VIEW gs_wlm_session_statistics AS SELECT diff --git a/src/common/backend/utils/init/globals.cpp b/src/common/backend/utils/init/globals.cpp index 8e4b01959..a6597fc24 100644 --- a/src/common/backend/utils/init/globals.cpp +++ b/src/common/backend/utils/init/globals.cpp @@ -59,7 +59,7 @@ bool open_join_children = true; bool will_shutdown = false; /* hard-wired binary version number */ -const uint32 GRAND_VERSION_NUM = 92306; +const uint32 GRAND_VERSION_NUM = 92307; const uint32 MATVIEW_VERSION_NUM = 92213; const uint32 PARTIALPUSH_VERSION_NUM = 92087; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_307.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_307.sql new file mode 100644 index 000000000..c8a8c756c --- /dev/null +++ b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback-post_catalog_maindb_92_307.sql @@ -0,0 +1,14 @@ +CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS +SELECT + S.datid AS datid, + S.usename, + S.pid, + S.query_start AS start_time, + T.min_cpu_time, + T.max_cpu_time, + T.total_cpu_time, + S.query, + S.node_group, + T.top_cpu_dn +FROM pg_stat_activity_ng AS S, pg_stat_get_wlm_realtime_session_info(NULL) AS T +WHERE S.pid = T.threadid; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_307.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_307.sql new file mode 100644 index 000000000..c8a8c756c --- /dev/null +++ b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback-post_catalog_otherdb_92_307.sql @@ -0,0 +1,14 @@ +CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS +SELECT + S.datid AS datid, + S.usename, + S.pid, + S.query_start AS start_time, + T.min_cpu_time, + T.max_cpu_time, + T.total_cpu_time, + S.query, + S.node_group, + T.top_cpu_dn +FROM pg_stat_activity_ng AS S, pg_stat_get_wlm_realtime_session_info(NULL) AS T +WHERE S.pid = T.threadid; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_307.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_307.sql new file mode 100644 index 000000000..36c7be418 --- /dev/null +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_307.sql @@ -0,0 +1,14 @@ +CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS +SELECT + S.datid AS datid, + S.usename, + S.pid, + S.query_start AS start_time, + T.min_cpu_time, + T.max_cpu_time, + T.total_cpu_time, + S.query, + S.node_group, + T.top_cpu_dn +FROM pg_stat_activity_ng AS S, pg_stat_get_wlm_realtime_session_info(NULL) AS T +WHERE S.sessionid = T.threadid; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_307.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_307.sql new file mode 100644 index 000000000..36c7be418 --- /dev/null +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_307.sql @@ -0,0 +1,14 @@ +CREATE OR REPLACE VIEW pg_catalog.gs_session_cpu_statistics AS +SELECT + S.datid AS datid, + S.usename, + S.pid, + S.query_start AS start_time, + T.min_cpu_time, + T.max_cpu_time, + T.total_cpu_time, + S.query, + S.node_group, + T.top_cpu_dn +FROM pg_stat_activity_ng AS S, pg_stat_get_wlm_realtime_session_info(NULL) AS T +WHERE S.sessionid = T.threadid; \ No newline at end of file