weird long time query - Mailing list pgsql-performance

From Kaijiang Chen
Subject weird long time query
Date
Msg-id CAAkGvS8ocfeVFOCsxoAY6suzMkrW+O9twRAQ2c4WrZNbQ=vSpg@mail.gmail.com
Whole thread Raw
Responses Re: weird long time query  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: weird long time query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
I'm using postgres 9.4.17 on centos 7.
I check the running queries with the following SQL:
SELECT
    procpid,  
    start,  
    now() - start AS lap,  
    current_query  
FROM
    (SELECT
        backendid,  
        pg_stat_get_backend_pid(S.backendid) AS procpid,  
        pg_stat_get_backend_activity_start(S.backendid) AS start,  
        pg_stat_get_backend_activity(S.backendid) AS current_query  
    FROM
        (SELECT pg_stat_get_backend_idset() AS backendid) AS S  
    ) AS S  
WHERE
    current_query <> '<IDLE>'
ORDER BY
    lap DESC;

Then, I found a SQL that has run for some days (and still running):
procpid       | 32638
start         | 2019-11-25 16:29:29.529318+08
lap           | 21 days 18:24:54.707369
current_query | DEALLOCATE pdo_stmt_00000388

I tried to kill it with: SELECT pg_cancel_backend(32638) but it takes no effects.

What's this query and what shall I do for it?

Best Wishes
Kaijiang

pgsql-performance by date:

Previous
From: Sam Gendler
Date:
Subject: Re: Consecutive Query Executions with Increasing Execution Time
Next
From: Andres Freund
Date:
Subject: Re: Consecutive Query Executions with Increasing Execution Time