mardi 3 février 2015

pg_stat_activity - is it possible to decompose a stored procedure further?


I got a long running query in pg_stat_activity:



datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start | query_start | state_change | waiting | state | query
-------+----------+------+----------+---------+-----------------------+-------------+-----------------+-------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+---------+--------+--------------------------------------------------
16385 | binstore | 3325 | 16644 | bucardo | bucardo KID (fe8fe10) | | | -1 | 2015-02-02 23:45:17.133177+00 | 2015-02-03 03:37:45.894859+00 | 2015-02-03 03:37:45.926591+00 | 2015-02-03 03:37:45.926592+00 | f | active | SELECT * FROM bucardo.bucardo_delta_check($1,$2)
(1 row)


The question is: is it possible to break down this bucardo.bucardo_delta_check stored procedure anyhow to get a notion of what exactly causes this query to run so long? Basically, I need an exact number of line of the SP code executing right now.





Aucun commentaire:

Enregistrer un commentaire