Thanks Chris. With those added to my script. I got this output:
datid | datname | procpid | usesysid | usename | current_query | waiting | xact_start | query_start | backend_start | client_addr | client_port
-------+-----------------+---------+----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-------------------------------+-------------------------------+-------------------------------+-------------+-------------
16386 | mysource_matrix | 27578 | 16385 | matrix_web | SELECT | f | 2012-02-29 05:22:14.654484-08 | 2012-02-29 05:22:14.654484-08 | 2012-02-29 05:21:28.443781-08 | | -1
: sq_ast_typ_inhd.type_code
: FROM
: sq_ast_typ_inhd
: WHERE
: (
: sq_ast_typ_inhd.inhd_type_code IN ($1)
: )
:
: ORDER BY sq_ast_typ_inhd.inhd_type_code, sq_ast_typ_inhd.type_code_lvl
16386 | mysource_matrix | 27650 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.101007-08 | 2012-02-29 05:21:45.647533-08 | | -1
16386 | mysource_matrix | 27463 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.646812-08 | 2012-02-29 05:21:01.807136-08 | | -1
16386 | mysource_matrix | 27521 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.507651-08 | 2012-02-29 05:21:12.177954-08 | | -1
16386 | mysource_matrix | 27638 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:11.927409-08 | 2012-02-29 05:22:11.927681-08 | 2012-02-29 05:21:44.780413-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27447 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.045876-08 | 2012-02-29 05:20:58.051492-08 | | -1
16386 | mysource_matrix | 27529 | 16385 | matrix_web | (SELECT DISTINCT(ll.majorid), ll.type_code, ll.treeid, length(ll.treeid)/$1 as depth FROM | f | 2012-02-29 05:22:14.609697-08 | 2012-02-29 05:22:14.609826-08 | 2012-02-29 05:21:13.379491-08 | | -1
: (
: SELECT a.assetid, l.majorid, t.treeid, a.type_code, a.name, a.short_name, a.version, a.status, a.languages, a.charset, a.force_secure, a.created, a.created_userid, a.updated, a.updated_userid, a.published, a.published_userid, a.status_changed, a.status_changed_userid FROM sq_ast_lnk_tree t
: INNER JOIN sq_ast_lnk l ON t.linkid = l.linkid
: INNER JOIN sq_ast a ON l.majorid = a.assetid WHERE ((t.treeid IN ('00050003000C0011000A0008000F000E','00050003000C0011000A0008000F','00050003000C0011000A0008','00050003000C0011000A','00050003000C0011','00050003000C','00050003','0005','00020006000F0004000F000E','00020006000F0004000F','00020006000F0004','00020006000F','00020006','0002','00050005000P0004000I000E','00050005000P0004000I','00050005000P0004','00050005000P','00050005','00020006000F000E0001000M000E','00020006000F000E0001000M','00020006000F000E0001','00020006000F000E','00050005000H0008000M000E','0005000500
16386 | mysource_matrix | 27561 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.142654-08 | 2012-02-29 05:21:22.052214-08 | | -1
16386 | mysource_matrix | 27520 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.985714-08 | 2012-02-29 05:21:12.027195-08 | | -1
16386 | mysource_matrix | 27726 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.342017-08 | 2012-02-29 05:22:12.320336-08 | | -1
16386 | mysource_matrix | 27637 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:11.614566-08 | 2012-02-29 05:22:11.614705-08 | 2012-02-29 05:21:44.714571-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27727 | 16385 | matrix_web | | f | | | 2012-02-29 05:22:12.562002-08 | | -1
16386 | mysource_matrix | 27711 | 16385 | matrix_web | | f | | 2012-02-29 05:22:09.144435-08 | 2012-02-29 05:22:08.018651-08 | | -1
16386 | mysource_matrix | 27491 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.652199-08 | 2012-02-29 05:21:06.431104-08 | | -1
16386 | mysource_matrix | 27439 | 16385 | matrix_web | SELECT l.minorid, l.majorid, l.linkid, l.value, l.link_type, | f | 2012-02-29 05:22:14.554222-08 | 2012-02-29 05:22:14.554222-08 | 2012-02-29 05:20:55.75934-08 | | -1
: l.type_code as major_type_code, l.sort_order, l.is_dependant, l.is_exclusive, l.locked FROM sq_vw_ast_lnk_major l WHERE l.minorid IN ($1)
: AND (l.link_type & $2) > 0 AND l.is_dependant = $3 ORDER BY l.sort_order, l.type_code
16386 | mysource_matrix | 27575 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.641482-08 | 2012-02-29 05:21:27.45-08 | | -1
16386 | mysource_matrix | 27681 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:12.332038-08 | 2012-02-29 05:22:12.33282-08 | 2012-02-29 05:21:57.347359-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27492 | 16385 | matrix_web | DEALLOCATE pdo_stmt_00000291 | f | | 2012-02-29 05:22:14.584719-08 | 2012-02-29 05:21:06.476177-08 | | -1
16386 | mysource_matrix | 27621 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.220845-08 | 2012-02-29 05:21:41.599393-08 | | -1
16386 | mysource_matrix | 27725 | 16385 | matrix_web | | f | | 2012-02-29 05:22:12.342428-08 | 2012-02-29 05:22:10.970535-08 | | -1
16386 | mysource_matrix | 27712 | 16385 | matrix_web | | f | | 2012-02-29 05:22:09.463973-08 | 2012-02-29 05:22:08.303968-08 | | -1
16386 | mysource_matrix | 27636 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.208495-08 | 2012-02-29 05:21:43.975293-08 | | -1
16386 | mysource_matrix | 27653 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:14.234352-08 | 2012-02-29 05:22:14.234541-08 | 2012-02-29 05:21:46.464439-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27610 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.649113-08 | 2012-02-29 05:21:37.649046-08 | | -1
16386 | mysource_matrix | 27516 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.64545-08 | 2012-02-29 05:21:11.463407-08 | | -1
16386 | mysource_matrix | 27708 | 16385 | matrix_web | | f | | 2012-02-29 05:22:08.735666-08 | 2012-02-29 05:22:07.070311-08 | | -1
16386 | mysource_matrix | 27569 | 16385 | matrix_web | | f | | 2012-02-29 05:22:12.52457-08 | 2012-02-29 05:21:25.524429-08 | | -1
16386 | mysource_matrix | 27709 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.096508-08 | 2012-02-29 05:22:07.399365-08 | | -1
16386 | mysource_matrix | 27723 | 16385 | matrix_web | | f | | | 2012-02-29 05:22:10.342483-08 | | -1
16386 | mysource_matrix | 27489 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.616527-08 | 2012-02-29 05:21:05.846065-08 | | -1
16386 | mysource_matrix | 27713 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.217419-08 | 2012-02-29 05:22:08.352848-08 | | -1
16386 | mysource_matrix | 27501 | 16385 | matrix_web | SELECT l.minorid, l.majorid, l.linkid, l.value, l.link_type, | f | 2012-02-29 05:22:14.581623-08 | 2012-02-29 05:22:14.581623-08 | 2012-02-29 05:21:06.782812-08 | | -1
: l.type_code as major_type_code, l.sort_order, l.is_dependant, l.is_exclusive, l.locked FROM sq_vw_ast_lnk_major l INNER JOIN sq_ast_perm p ON p.assetid = l.majorid LEFT JOIN sq_vw_ast_role r ON (p.userid = r.roleid AND r.assetid = l.minorid) WHERE l.minorid IN ($1)
: AND (l.link_type & $2) > 0 AND (p.userid IN ($3,$4,$5) OR r.userid IN ($6,$7,$8))
: AND (
: (p.permission = 1 AND (
: p.userid <> $9
: OR r.userid <> $10
: OR (p.userid = $11 AND p.granted = '1')
: OR (r.userid = $12 AND p.granted = '1')
: )
: ) OR (p.permission > $13 AND p.granted = '1')) AND l.type_code IN (
: SELECT type_code
: FROM sq_ast_typ_inhd
: WHERE inhd_type_code IN ($14)
: ) GROUP BY l.linkid, l.minorid, l.majorid, l.value, l.link_type,
: l.type_code, l.sort_order, l.is_dependant, l.is_exclusive, l.locked, p.assetid HAVING MIN(p.granted) <> '0' ORDER BY l.sort_order, l.ty
16386 | mysource_matrix | 27628 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:12.686659-08 | 2012-02-29 05:22:12.686945-08 | 2012-02-29 05:21:43.087766-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27699 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:13.613739-08 | 2012-02-29 05:22:13.614071-08 | 2012-02-29 05:22:03.987491-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27710 | 16385 | matrix_web | | f | | 2012-02-29 05:22:08.765236-08 | 2012-02-29 05:22:07.549149-08 | | -1
16386 | mysource_matrix | 27565 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.569013-08 | 2012-02-29 05:21:23.265678-08 | | -1
16386 | mysource_matrix | 27728 | 16385 | matrix_web | | f | | | 2012-02-29 05:22:12.63204-08 | | -1
16386 | mysource_matrix | 27714 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.506968-08 | 2012-02-29 05:22:08.372593-08 | | -1
16386 | mysource_matrix | 27680 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:11.481805-08 | 2012-02-29 05:22:11.482464-08 | 2012-02-29 05:21:56.815447-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27674 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.540454-08 | 2012-02-29 05:21:53.651338-08 | | -1
16386 | mysource_matrix | 27519 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.624831-08 | 2012-02-29 05:21:11.802905-08 | | -1
16386 | mysource_matrix | 27522 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.278017-08 | 2012-02-29 05:21:12.201854-08 | | -1
16386 | mysource_matrix | 27696 | 16385 | matrix_web | SELECT | f | | 2012-02-29 05:22:14.651631-08 | 2012-02-29 05:22:03.84097-08 | | -1
: sq_cache.expires, sq_cache.path
: FROM
: sq_cache
: WHERE
: (
: sq_cache.cache_key = ($1)
: AND sq_cache.perm_key = ($2)
: AND sq_cache.url = ($3)
: )
:
16386 | mysource_matrix | 27715 | 16385 | matrix_web | | f | | 2012-02-29 05:22:09.816241-08 | 2012-02-29 05:22:08.651401-08 | | -1
16386 | mysource_matrix | 27629 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.280323-08 | 2012-02-29 05:21:43.168765-08 | | -1
16386 | mysource_matrix | 27570 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.47262-08 | 2012-02-29 05:21:25.715369-08 | | -1
16386 | mysource_matrix | 27583 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.647497-08 | 2012-02-29 05:21:29.416055-08 | | -1
16386 | mysource_matrix | 27716 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.06169-08 | 2012-02-29 05:22:08.911317-08 | | -1
16386 | mysource_matrix | 27537 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.63377-08 | 2012-02-29 05:21:15.323747-08 | | -1
16386 | mysource_matrix | 27538 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.562349-08 | 2012-02-29 05:21:15.46449-08 | | -1
16386 | mysource_matrix | 27546 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.596611-08 | 2012-02-29 05:21:17.787425-08 | | -1
16386 | mysource_matrix | 27545 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.653016-08 | 2012-02-29 05:21:17.74755-08 | | -1
16386 | mysource_matrix | 27611 | 16385 | matrix_web | | f | | 2012-02-29 05:22:08.206541-08 | 2012-02-29 05:21:37.675313-08 | | -1
16386 | mysource_matrix | 27675 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.518031-08 | 2012-02-29 05:21:53.879824-08 | | -1
16386 | mysource_matrix | 27553 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.57785-08 | 2012-02-29 05:21:19.15138-08 | | -1
16386 | mysource_matrix | 27648 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:13.640553-08 | 2012-02-29 05:22:13.640901-08 | 2012-02-29 05:21:45.107518-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27717 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.573078-08 | 2012-02-29 05:22:08.969216-08 | | -1
16386 | mysource_matrix | 27649 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:11.805074-08 | 2012-02-29 05:22:11.805813-08 | 2012-02-29 05:21:45.237933-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27557 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.653993-08 | 2012-02-29 05:21:20.231838-08 | | -1
16386 | mysource_matrix | 27558 | 16385 | matrix_web | | f | | 2012-02-29 05:22:10.738948-08 | 2012-02-29 05:21:21.271337-08 | | -1
16386 | mysource_matrix | 27559 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.629992-08 | 2012-02-29 05:21:21.5018-08 | | -1
11564 | postgres | 27729 | 10 | postgres | SELECT * FROM pg_stat_activity; | f | 2012-02-29 05:22:14.396493-08 | 2012-02-29 05:22:14.396493-08 | 2012-02-29 05:22:13.925439-08 | | -1
16386 | mysource_matrix | 27566 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.411204-08 | 2012-02-29 05:21:23.303327-08 | | -1
16386 | mysource_matrix | 27048 | 16385 | matrix_web | | f | | 2012-02-29 05:18:53.087581-08 | 2012-02-29 05:17:31.123626-08 | | -1
16386 | mysource_matrix | 27571 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.646916-08 | 2012-02-29 05:21:25.923099-08 | | -1
16386 | mysource_matrix | 27572 | 16385 | matrix_web | | f | | 2012-02-29 05:22:12.046363-08 | 2012-02-29 05:21:26.343887-08 | | -1
16386 | mysource_matrix | 27574 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.371174-08 | 2012-02-29 05:21:26.859306-08 | | -1
16386 | mysource_matrix | 27584 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.068697-08 | 2012-02-29 05:21:29.834053-08 | | -1
16386 | mysource_matrix | 27585 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.245422-08 | 2012-02-29 05:21:30.571454-08 | | -1
16386 | mysource_matrix | 27724 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.749047-08 | 2012-02-29 05:22:10.620102-08 | | -1
16386 | mysource_matrix | 27587 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.61938-08 | 2012-02-29 05:21:31.023725-08 | | -1
16386 | mysource_matrix | 27589 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.65201-08 | 2012-02-29 05:21:31.154654-08 | | -1
16386 | mysource_matrix | 27590 | 16385 | matrix_web | SELECT DISTINCT a.assetid, l.majorid, a.type_code, a.status, a.name, a.short_name, pt.path, l.sort_order | f | | 2012-02-29 05:22:14.59255-08 | 2012-02-29 05:21:31.367384-08 | | -1
: FROM sq_ast a
: INNER JOIN sq_ast_lnk l ON a.assetid = l.minorid
: INNER JOIN sq_ast_path pt ON a.assetid = pt.assetid
: INNER JOIN sq_ast_perm p ON a.assetid = p.assetid
: LEFT JOIN sq_vw_ast_role r ON p.userid = r.roleid AND p.assetid = r.assetid WHERE l.majorid IN ('58014')
: AND (l.link_type & 1) > 0 AND (p.userid IN ($1, $2, $3) OR r.userid IN ($4, $5, $6)) AND (
: (p.permission = $7 AND (
: p.userid <> $8
: OR r.userid <> $9
: OR (p.userid = $10 AND p.granted = '1')
: OR (r.userid = $11 AND p.granted = '1')
: )
: )
: OR (
: p.permission > $12 AND p.granted = '1'
: )
: )
: GROUP BY a.assetid, l.majorid, a.type_code, a.status, a.name, a.short_name, pt.path, l.sort_order, p.assetid
: HAVING MIN(p.granted) <> '0'
: ORDER BY l.majorid, l.sort_order
16386 | mysource_matrix | 27677 | 16385 | matrix_web | | f | | 2012-02-29 05:22:08.313736-08 | 2012-02-29 05:21:55.126947-08 | | -1
16386 | mysource_matrix | 27594 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.755029-08 | 2012-02-29 05:21:31.781899-08 | | -1
16386 | mysource_matrix | 27596 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.919734-08 | 2012-02-29 05:21:32.413323-08 | | -1
16386 | mysource_matrix | 27601 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.516277-08 | 2012-02-29 05:21:33.843016-08 | | -1
16386 | mysource_matrix | 27656 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.657782-08 | 2012-02-29 05:21:47.142998-08 | | -1
16386 | mysource_matrix | 27603 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.544729-08 | 2012-02-29 05:21:34.339694-08 | | -1
16386 | mysource_matrix | 27604 | 16385 | matrix_web | | f | | 2012-02-29 05:22:06.063141-08 | 2012-02-29 05:21:34.359029-08 | | -1
16386 | mysource_matrix | 27683 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:12.966789-08 | 2012-02-29 05:22:12.967026-08 | 2012-02-29 05:21:58.180403-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27684 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:11.952112-08 | 2012-02-29 05:22:11.952661-08 | 2012-02-29 05:21:58.190629-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27607 | 16385 | matrix_web | SELECT DISTINCT a.assetid, l.majorid, a.type_code, a.status, a.name, a.short_name, pt.path, l.sort_order | f | 2012-02-29 05:22:14.519129-08 | 2012-02-29 05:22:14.519129-08 | 2012-02-29 05:21:35.277818-08 | | -1
: FROM sq_ast a
: INNER JOIN sq_ast_lnk l ON a.assetid = l.minorid
: INNER JOIN sq_ast_path pt ON a.assetid = pt.assetid
: INNER JOIN sq_ast_perm p ON a.assetid = p.assetid
: LEFT JOIN sq_vw_ast_role r ON p.userid = r.roleid AND p.assetid = r.assetid WHERE l.majorid IN ('46')
: AND (l.link_type & 1) > 0 AND (p.userid IN ($1, $2, $3) OR r.userid IN ($4, $5, $6)) AND (
: (p.permission = $7 AND (
: p.userid <> $8
: OR r.userid <> $9
: OR (p.userid = $10 AND p.granted = '1')
: OR (r.userid = $11 AND p.granted = '1')
: )
: )
: OR (
: p.permission > $12 AND p.granted = '1'
: )
: )
: GROUP BY a.assetid, l.majorid, a.type_code, a.status, a.name, a.short_name, pt.path, l.sort_order, p.assetid
: HAVING MIN(p.granted) <> '0'
: ORDER BY l.majorid, l.sort_order
16386 | mysource_matrix | 27609 | 16385 | matrix_web | | f | | 2012-02-29 05:22:12.822155-08 | 2012-02-29 05:21:36.511386-08 | | -1
16386 | mysource_matrix | 27698 | 16385 | matrix_web | SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type | f | 2012-02-29 05:22:14.06043-08 | 2012-02-29 05:22:14.060602-08 | 2012-02-29 05:22:03.947356-08 | | -1
: FROM sq_ast_lookup l
: INNER JOIN sq_ast a ON l.assetid = a.assetid
: INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
: WHERE l.root_urlid = 13
: AND l.url IN (
: SELECT * FROM sq_get_lineage_from_url($1)
: )
: GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
: ORDER BY l.url ASC
16386 | mysource_matrix | 27630 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.805683-08 | 2012-02-29 05:21:43.271387-08 | | -1
16386 | mysource_matrix | 27657 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.624329-08 | 2012-02-29 05:21:47.944135-08 | | -1
16386 | mysource_matrix | 27658 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.228413-08 | 2012-02-29 05:21:48.595872-08 | | -1
16386 | mysource_matrix | 27659 | 16385 | matrix_web | | f | | 2012-02-29 05:22:11.829464-08 | 2012-02-29 05:21:48.647435-08 | | -1
16386 | mysource_matrix | 27660 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.625408-08 | 2012-02-29 05:21:49.103529-08 | | -1
16386 | mysource_matrix | 27094 | 16385 | matrix_web | | f | | 2012-02-29 05:18:49.90279-08 | 2012-02-29 05:17:55.492714-08 | | -1
16386 | mysource_matrix | 27661 | 16385 | matrix_web | | f | | 2012-02-29 05:22:12.460474-08 | 2012-02-29 05:21:49.64548-08 | | -1
16386 | mysource_matrix | 27662 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.172023-08 | 2012-02-29 05:21:49.871414-08 | | -1
16386 | mysource_matrix | 27663 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.587096-08 | 2012-02-29 05:21:50.040005-08 | | -1
16386 | mysource_matrix | 27667 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.333256-08 | 2012-02-29 05:21:51.083658-08 | | -1
16386 | mysource_matrix | 27668 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.334118-08 | 2012-02-29 05:21:51.768765-08 | | -1
16386 | mysource_matrix | 27666 | 16385 | matrix_web | | f | | 2012-02-29 05:22:13.381337-08 | 2012-02-29 05:21:50.831367-08 | | -1
16386 | mysource_matrix | 27672 | 16385 | matrix_web | | f | | 2012-02-29 05:22:14.12038-08 | 2012-02-29 05:21:52.527446-08 | | -1
(98 rows)
\n------PROCESSES-------
PID TTY TIME CMD
1 ? 00:00:30 init
2 ? 00:00:00 kthreadd
3 ? 00:00:02 migration/0
4 ? 00:00:03 ksoftirqd/0
5 ? 00:00:00 watchdog/0
6 ? 00:00:02 migration/1
7 ? 00:00:01 ksoftirqd/1
8 ? 00:00:00 watchdog/1
9 ? 00:00:09 events/0
10 ? 00:00:59 events/1
11 ? 00:00:00 cpuset
12 ? 00:00:00 khelper
13 ? 00:00:00 netns
14 ? 00:00:00 async/mgr
15 ? 00:00:00 pm
16 ? 00:00:03 sync_supers
17 ? 00:00:02 bdi-default
18 ? 00:00:00 kintegrityd/0
19 ? 00:00:00 kintegrityd/1
20 ? 00:02:33 kblockd/0
21 ? 00:02:19 kblockd/1
22 ? 00:00:00 kacpid
23 ? 00:00:00 kacpi_notify
24 ? 00:00:00 kacpi_hotplug
25 ? 00:00:00 kseriod
26 ? 00:00:00 kondemand/0
27 ? 00:00:00 kondemand/1
30 ? 00:00:00 khungtaskd
31 ? 00:02:03 kswapd0
32 ? 00:00:00 ksmd
33 ? 00:00:00 aio/0
34 ? 00:00:00 aio/1
35 ? 00:00:00 crypto/0
36 ? 00:00:00 crypto/1
153 ? 00:00:00 ata/0
154 ? 00:00:00 ata/1
155 ? 00:00:00 ata_aux
157 ? 00:00:00 scsi_eh_0
159 ? 00:00:00 scsi_eh_1
194 ? 00:02:30 flush-8:0
195 ? 00:07:41 kjournald
242 ? 00:00:00 udevd
373 ? 00:00:00 kpsmoused
713 ? 00:01:03 rsyslogd
742 ? 00:00:02 acpid
791 ? 00:00:29 cron
982 ? 00:00:00 udevd
983 ? 00:00:00 udevd
1068 ? 00:00:00 sshd
1166 ? 00:04:51 apache2
1469 ? 00:00:00 squid
26018 ? 00:00:00 sshd
27685 ? 00:00:00 cron
27695 ? 00:00:00 sh
27697 ? 00:00:00 pgstats.sh
27742 ? 00:00:00 ps
31604 ? 00:00:20 python
\n------LOCKS-------
locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted
------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-------+------------------+---------
relation | 16386 | 16994 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 17055 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 12/14404 | 27727 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 17054 | | | | | | | | 81/286 | 27749 | AccessShareLock | t
relation | 16386 | 17067 | | | | | | | | 59/4648 | 27557 | AccessShareLock | t
relation | 16386 | 17056 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 16462 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 17077 | | | | | | | | 20/4820 | 27725 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 16902 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16906 | | | | | | | | 40/1870 | 27674 | AccessShareLock | t
virtualxid | | | | | 95/2961 | | | | | 95/2961 | 27663 | ExclusiveLock | t
relation | 16386 | 16405 | | | | | | | | 95/2961 | 27663 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 96/1390 | 27745 | AccessShareLock | t
relation | 16386 | 17067 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
virtualxid | | | | | 20/4820 | | | | | 20/4820 | 27725 | ExclusiveLock | t
virtualxid | | | | | 49/3355 | | | | | 49/3355 | 27537 | ExclusiveLock | t
relation | 16386 | 17058 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17002 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 17065 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17072 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16918 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 29/6478 | 27723 | AccessShareLock | t
relation | 16386 | 17063 | | | | | | | | 81/286 | 27749 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 37/7678 | 27728 | AccessShareLock | t
relation | 16386 | 17057 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16566 | | | | | | | | 20/4820 | 27725 | AccessShareLock | t
relation | 16386 | 16566 | | | | | | | | 20/4820 | 27725 | RowExclusiveLock | t
virtualxid | | | | | 18/7649 | | | | | 18/0 | 27758 | ExclusiveLock | t
relation | 16386 | 16469 | | | | | | | | 37/7678 | 27728 | AccessShareLock | t
relation | 16386 | 16906 | | | | | | | | 96/1390 | 27745 | AccessShareLock | t
virtualxid | | | | | 55/2234 | | | | | 55/0 | 27748 | ExclusiveLock | t
relation | 16386 | 17002 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 17066 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16469 | | | | | | | | 95/2961 | 27663 | AccessShareLock | t
relation | 16386 | 17054 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16932 | | | | | | | | 20/4820 | 27725 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 40/1870 | 27674 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 12/14404 | 27727 | AccessShareLock | t
relation | 16386 | 16508 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 95/2961 | 27663 | AccessShareLock | t
relation | 16386 | 17054 | | | | | | | | 59/4648 | 27557 | AccessShareLock | t
relation | 16386 | 16918 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17072 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 16469 | | | | | | | | 12/14404 | 27727 | AccessShareLock | t
relation | 16386 | 17063 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
virtualxid | | | | | 15/7538 | | | | | 15/0 | 27439 | ExclusiveLock | t
relation | 16386 | 17056 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 37/7678 | 27728 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16902 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 2603 | | | | | | | | 50/3710 | 27759 | AccessShareLock | t
relation | 16386 | 16415 | | | | | | | | 1/3870204 | 27578 | AccessShareLock | t
relation | 16386 | 17063 | | | | | | | | 59/4648 | 27557 | AccessShareLock | t
virtualxid | | | | | 81/286 | | | | | 81/286 | 27749 | ExclusiveLock | t
relation | 16386 | 16906 | | | | | | | | 29/6478 | 27723 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 59/4648 | 27557 | AccessShareLock | t
relation | 16386 | 16513 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16880 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16469 | | | | | | | | 29/6478 | 27723 | AccessShareLock | t
virtualxid | | | | | 62/3877 | | | | | 62/3877 | 27741 | ExclusiveLock | t
virtualxid | | | | | 59/4648 | | | | | 59/4648 | 27557 | ExclusiveLock | t
relation | 16386 | 17064 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 37/7678 | 27728 | AccessShareLock | t
relation | 16386 | 17063 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 29/6478 | 27723 | AccessShareLock | t
virtualxid | | | | | 37/7678 | | | | | 37/7678 | 27728 | ExclusiveLock | t
relation | 16386 | 17196 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 17055 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17067 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 17056 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17057 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 96/1390 | 27745 | AccessShareLock | t
virtualxid | | | | | 29/6478 | | | | | 29/6478 | 27723 | ExclusiveLock | t
relation | 16386 | 16566 | | | | | | | | 50/3710 | 27759 | AccessShareLock | t
relation | 16386 | 16906 | | | | | | | | 12/14404 | 27727 | AccessShareLock | t
relation | 16386 | 16918 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16906 | | | | | | | | 95/2961 | 27663 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 40/1870 | 27674 | AccessShareLock | t
relation | 16386 | 17054 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
virtualxid | | | | | 44/2371 | | | | | 44/2371 | 27715 | ExclusiveLock | t
relation | 16386 | 17058 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 16469 | | | | | | | | 96/1390 | 27745 | AccessShareLock | t
relation | 16386 | 17071 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 17049 | | | | | | | | 1/3870204 | 27578 | AccessShareLock | t
relation | 16386 | 16520 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16566 | | | | | | | | 18/0 | 27758 | AccessShareLock | t
relation | 16386 | 16914 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 17059 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
relation | 16386 | 16918 | | | | | | | | 59/4648 | 27557 | AccessShareLock | t
virtualxid | | | | | 72/5232 | | | | | 72/5232 | 27587 | ExclusiveLock | t
relation | 16386 | 17057 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
virtualxid | | | | | 12/14404 | | | | | 12/14404 | 27727 | ExclusiveLock | t
relation | 16386 | 16566 | | | | | | | | 44/2371 | 27715 | AccessShareLock | t
virtualxid | | | | | 96/1390 | | | | | 96/1390 | 27745 | ExclusiveLock | t
relation | 16386 | 17054 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
relation | 16386 | 17071 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16920 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16906 | | | | | | | | 37/7678 | 27728 | AccessShareLock | t
relation | 16386 | 16932 | | | | | | | | 18/0 | 27758 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 29/6478 | 27723 | AccessShareLock | t
relation | 16386 | 17002 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 11564 | 10969 | | | | | | | | 14/5931 | 27760 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
virtualxid | | | | | 14/5931 | | | | | 14/5931 | 27760 | ExclusiveLock | t
relation | 16386 | 16830 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16405 | | | | | | | | 81/286 | 27749 | AccessShareLock | t
relation | 16386 | 16932 | | | | | | | | 50/3710 | 27759 | AccessShareLock | t
relation | 16386 | 16902 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16440 | | | | | | | | 1/3870204 | 27578 | AccessShareLock | t
relation | 16386 | 17197 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 17195 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16918 | | | | | | | | 81/286 | 27749 | AccessShareLock | t
relation | 16386 | 17063 | | | | | | | | 55/0 | 27748 | AccessShareLock | t
virtualxid | | | | | 1/3870204 | | | | | 1/3870204 | 27578 | ExclusiveLock | t
virtualxid | | | | | 50/3710 | | | | | 50/3710 | 27759 | ExclusiveLock | t
relation | 16386 | 16405 | | | | | | | | 96/1390 | 27745 | AccessShareLock | t
relation | 16386 | 16469 | | | | | | | | 40/1870 | 27674 | AccessShareLock | t
relation | 16386 | 17067 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 95/2961 | 27663 | AccessShareLock | t
relation | 16386 | 17028 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 16904 | | | | | | | | 15/0 | 27439 | AccessShareLock | t
virtualxid | | | | | 40/1870 | | | | | 40/1870 | 27674 | ExclusiveLock | t
relation | 16386 | 17076 | | | | | | | | 20/4820 | 27725 | AccessShareLock | t
relation | 16386 | 16916 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
relation | 16386 | 16452 | | | | | | | | 12/14404 | 27727 | AccessShareLock | t
relation | 16386 | 17058 | | | | | | | | 40/1870 | 27674 | AccessShareLock | t
relation | 16386 | 17055 | | | | | | | | 49/3355 | 27537 | AccessShareLock | t
relation | 16386 | 118405 | | | | | | | | 72/5232 | 27587 | AccessShareLock | t
(133 rows)
Dan, I've added your suggestions to the cron job, so the next time we are over about 90 connections we'll have that data too.