You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/03/10 07:19:40 UTC

[jira] [Commented] (HAWQ-509) Run "select * from pg_stat_activity" returns multiple records for one query

    [ https://issues.apache.org/jira/browse/HAWQ-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15188752#comment-15188752 ] 

ASF GitHub Bot commented on HAWQ-509:
-------------------------------------

GitHub user ictmalili opened a pull request:

    https://github.com/apache/incubator-hawq/pull/428

    HAWQ-509. Change pg_stat_activity definition, only returns one record…

    Change pg_stat_activity definition, only returns one record for one query.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ictmalili/incubator-hawq HAWQ-509

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/428.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #428
    
----
commit 7c2c4916694c441d038f9d8506ab9b8a43e70abb
Author: Lili Ma <lm...@pivotal.io>
Date:   2016-03-10T06:16:44Z

    HAWQ-509. Change pg_stat_activity definition, only returns one record for one query

----


> 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
>
> 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)