Event Timeline
Comment Actions
postgres=# select count(*) from pg_stat_activity where query like '%UNNEST(%'; count ------- 64 (1 row)
Comment Actions
postgres=# select count(*) from pg_stat_activity where query like '%UNNEST(%'; count ------- 64 (1 row) postgres=# select pid, query from pg_stat_activity where query like '%UNNEST(%' limit 1; pid | query --------+------------------------------------------------------------------------------------------------------------- 774191 | + | WITH + | dir AS (SELECT dir_entries, file_entries + | FROM directory WHERE id='\x876eba4d69d7f54587b55b0f66a6e0cc3fdab1d3'::bytea),+ | ls_d AS (SELECT DISTINCT UNNEST(dir_entries) AS entry_id FROM dir), + | ls_f AS (SELECT DISTINCT UNNEST(file_entries) AS entry_id FROM dir) + | (SELECT 'dir' AS type, e.target, e.name + | FROM ls_d + | LEFT JOIN directory_entry_dir e ON ls_d.entry_id=e.id) + | UNION ALL + | (SELECT 'file' AS type, e.target, e.name + | FROM ls_f + | LEFT JOIN directory_entry_file e ON ls_f.entry_id=e.id) + | (1 row) postgres=# select pg_terminate_backend(774191); pg_terminate_backend ---------------------- t (1 row) postgres=# select count(*) from pg_stat_activity where query like '%UNNEST(%' and pid <> pg_backend_pid(); count ------- 62 (1 row) postgres=# select pg_terminate_backend(pid) from pg_stat_activity where query like '%UNNEST(%' and pid <> pg_backend_pid(); ... 62 rows