[
https://issues.apache.org/jira/browse/HAWQ-509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lili Ma resolved HAWQ-509.
--------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
> Run "select * from pg_stat_activity" returns multiple records for one query
> ---------------------------------------------------------------------------
>
> Key: HAWQ-509
> URL: https://issues.apache.org/jira/browse/HAWQ-509
> Project: Apache HAWQ
> Issue Type: Bug
> Components: Catalog
> Reporter: Lili Ma
> Assignee: Lili Ma
> Fix For: 2.0.0
>
>
> Run a query which contains function will generate multiple records in
> pg_stat_activity.
> {code}
> create sequence sri_seq;
> create table sri_table (tid bigint, bdate date, aid int, delta int, mtime
> timestamp) with (appendonly = true, orientation = PARQUET, pagesize =
> 1048576, rowgroupsize = 8388608, compresstype = SNAPPY)distributed by (tid) ;
> gpsqltest_sri_parquet_part_hash_gpadmin=# begin;
> BEGIN
> gpsqltest_sri_parquet_part_hash_gpadmin=# INSERT INTO sri_table (tid, bdate,
> aid, delta, mtime) VALUES (nextval('sri_seq'), '1993-10-14', 1, 1,
> current_timestamp);
> INSERT 0 1
> {code}
> Run ps -ef |grep postgres
> {code}
> gpadmin 604929 604400 13 01:40 ? 00:00:02 postgres: port 5432,
> gpadmin gpsqltest_... [local] con38 cmd3 idle in transaction [local]
> gpadmin 604936 604400 1 01:40 ? 00:00:00 postgres: port 5432,
> gpadmin gpsqltest_... [local] con38 seg-1 idle
> {code}
> Run select from pg_stat_activity, there are two records for single insert.
> Should only return one record.
> {code}
> postgres=# select * from pg_stat_activity ;
> datid | datname | procpid | sess_id |
> usesysid | usename | current_query | waiting |
> query_start | backend_start | clie
> nt_addr | client_port | application_name | xact_start |
> waiting_resource
> -------+-----------------------------------------+---------+---------+----------+---------+----------------------------------+---------+-------------------------------+-------------------------------+-----
> --------+-------------+------------------+-------------------------------+------------------
> 47622 | gpsqltest_sri_parquet_part_hash_gpadmin | 604936 | 38 |
> 10 | gpadmin | <IDLE> | f | 2016-01-27
> 01:40:57.94057-08 | 2016-01-27 01:41:00.132015-08 |
> | -1 | | | f
> 47622 | gpsqltest_sri_parquet_part_hash_gpadmin | 604929 | 38 |
> 10 | gpadmin | <IDLE> in transaction | f | 2016-01-27
> 01:40:57.94057-08 | 2016-01-27 01:40:45.784561-08 |
> | -1 | psql | 2016-01-27 01:40:50.180561-08 | f
> 16387 | postgres | 604946 | 40 |
> 10 | gpadmin | select * from pg_stat_activity ; | f | 2016-01-27
> 01:41:22.163617-08 | 2016-01-27 01:41:10.059942-08 |
> | -1 | psql | 2016-01-27 01:41:22.163617-08 | f
> (3 rows)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)