Database : Statistics of activity| datid oid(10) | datname name(2147483647) | pid int4(11) | leader_pid int4(11) | usesysid oid(10) | usename name(2147483647) | application_name text(2147483647) | client_addr inet(2147483647) | client_hostname text(2147483647) | client_port int4(11) | backend_start timestamptz(35) | xact_start timestamptz(35) | query_start timestamptz(35) | state_change timestamptz(35) | wait_event_type text(2147483647) | wait_event text(2147483647) | state text(2147483647) | backend_xid xid(2147483647) | backend_xmin xid(2147483647) | query_id int8(20) | query text(2147483647) | backend_type text(2147483647) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5 | postgres | 1427 | 10 | rdsadmin | pg_cron scheduler | 2025-10-09 16:28:05.073515-03 | 804233201376169930 | pg_cron launcher | |||||||||||||
| 1428 | 10 | rdsadmin | 2025-10-09 16:28:05.073701-03 | Activity | LogicalLauncherMain | logical replication launcher | |||||||||||||||
| 1665815312 | documents | 23688 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.253 | 27331 | 2025-12-10 22:09:07.647271-03 | 2025-12-10 22:16:18.737734-03 | 2025-12-10 22:16:18.737803-03 | Client | ClientRead | idle | client backend | |||||||
| 5 | postgres | 16007 | 3333668727 | rdsproxyadmin | 10.0.24.253 | 65293 | 2025-12-10 21:34:00.06404-03 | 2025-12-10 22:16:17.928921-03 | 2025-12-10 22:16:17.92901-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 5 | postgres | 16008 | 3333668727 | rdsproxyadmin | 10.0.20.251 | 60013 | 2025-12-10 21:34:00.295323-03 | 2025-12-10 22:16:18.034886-03 | 2025-12-10 22:16:18.034971-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 5 | postgres | 16009 | 3333668727 | rdsproxyadmin | 10.0.24.138 | 17183 | 2025-12-10 21:34:00.458535-03 | 2025-12-10 22:16:18.285149-03 | 2025-12-10 22:16:18.285243-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 1665815312 | documents | 24745 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.251 | 44203 | 2025-12-10 22:16:05.63812-03 | 2025-12-10 22:16:06.837203-03 | 2025-12-10 22:16:06.842966-03 | Client | ClientRead | idle | -8625620423702777529 | WITH status_lista AS ( SELECT unnest(ARRAY[ 'PENDENTE', 'CONCLUIDO', 'EM_PROCESSAMENTO', 'COM_ERRO', 'COM_ERRO_PERMANENTE' ]) AS status ), recorrente_lista AS ( SELECT unnest(ARRAY[true, false]) AS recorrente ), combinacoes AS ( SELECT s.status, r.recorrente FROM status_lista s CROSS JOIN recorrente_lista r ), contagens AS ( SELECT status, recorrente, COUNT(*) AS qtd FROM cfe_periodo_importacao_job WHERE data_fim <= now() AT TIME ZONE 'America/Sao_Paulo' AND status IS NOT NULL AND status IN ('PENDENTE','CONCLUIDO','EM_PROCESSAMENTO','COM_ERRO','COM_ERRO_PERMANENTE') GROUP BY status, recorrente ) SELECT COALESCE(ct.qtd, 0) AS "Qtd", c.status AS "Status", c.recorrente AS "Recorrente" FROM combinacoes c LEFT JOIN contagens ct ON c.status = ct.status AND c.recorrente = ct.recorrente ORDER BY c.status, c.recorrente; | client backend | |||||
| 5 | postgres | 14650 | 3333668727 | rdsproxyadmin | 10.0.24.81 | 3355 | 2025-12-10 19:28:00.461567-03 | 2025-12-10 22:16:18.296897-03 | 2025-12-10 22:16:18.296961-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 1665815312 | documents | 17338 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.185 | 45487 | 2025-12-10 21:39:04.507959-03 | 2025-12-10 22:16:12.369463-03 | 2025-12-10 22:16:12.369667-03 | Client | ClientRead | idle | client backend | |||||||
| 5 | postgres | 16012 | 3333668727 | rdsproxyadmin | 10.0.24.185 | 19199 | 2025-12-10 21:34:00.742069-03 | 2025-12-10 22:16:18.08532-03 | 2025-12-10 22:16:18.085381-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 5 | postgres | 16013 | 3333668727 | rdsproxyadmin | 10.0.24.71 | 25747 | 2025-12-10 21:34:00.772865-03 | 2025-12-10 22:16:18.40797-03 | 2025-12-10 22:16:18.408055-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 3333716331 | revizia | 23822 | 16402 | postgres | nfe-lambda-aws | 10.0.20.251 | 64041 | 2025-12-10 22:10:00.272635-03 | 2025-12-10 22:16:15.721591-03 | 2025-12-10 22:16:15.721637-03 | Client | ClientRead | idle | -5084201902893922806 | SELECT ce.conta_id FROM conta_empresa ce INNER JOIN empresa e ON ce.empresa_id = e.id INNER JOIN conta c on ce.conta_id = c.id WHERE e.cnpj IN ($1, $2) AND c.status = 'ATIVO' AND c.id <> 1 LIMIT 1 | client backend | |||||
| 1665815312 | documents | 23981 | 16402 | postgres | cfe-job-download-documentos | 10.0.20.84 | 42923 | 2025-12-10 22:11:04.616208-03 | 2025-12-10 22:16:18.618974-03 | 2025-12-10 22:16:18.619056-03 | Client | ClientRead | idle | client backend | |||||||
| 3333716331 | revizia | 24034 | 16402 | postgres | rvz-sintegra-job | 10.0.20.251 | 46479 | 2025-12-10 22:11:26.381331-03 | 2025-12-10 22:15:40.682515-03 | 2025-12-10 22:15:40.682614-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24576 | 16402 | postgres | econet-scrapper | 10.0.24.138 | 19089 | 2025-12-10 22:15:03.397638-03 | 2025-12-10 22:15:03.418092-03 | 2025-12-10 22:15:03.418109-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 3333716331 | revizia | 23060 | 16402 | postgres | nfe-lambda-aws | 10.0.24.81 | 64547 | 2025-12-10 22:05:17.294572-03 | 2025-12-10 22:14:41.819126-03 | 2025-12-10 22:14:41.819178-03 | Client | ClientRead | idle | -5084201902893922806 | SELECT ce.conta_id FROM conta_empresa ce INNER JOIN empresa e ON ce.empresa_id = e.id INNER JOIN conta c on ce.conta_id = c.id WHERE e.cnpj IN ($1, $2) AND c.status = 'ATIVO' AND c.id <> 1 LIMIT 1 | client backend | |||||
| 16450 | fiscal | 24621 | 16402 | postgres | econet-scrapper | 10.0.20.251 | 24653 | 2025-12-10 22:15:20.860947-03 | 2025-12-10 22:15:20.879622-03 | 2025-12-10 22:15:20.879629-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 5 | postgres | 16014 | 3333668727 | rdsproxyadmin | 10.0.20.84 | 24301 | 2025-12-10 21:34:00.959236-03 | 2025-12-10 22:16:18.01855-03 | 2025-12-10 22:16:18.018634-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 5 | postgres | 16015 | 3333668727 | rdsproxyadmin | 10.0.20.46 | 56341 | 2025-12-10 21:34:00.968397-03 | 2025-12-10 22:16:18.092966-03 | 2025-12-10 22:16:18.093042-03 | Client | ClientRead | idle | 2731926746234896378 | SELECT current_setting('transaction_read_only') AS transaction_read_only, current_setting('max_connections') AS max_connections, EXTRACT(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime; | client backend | ||||||
| 1665815312 | documents | 24433 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.24.185 | 57263 | 2025-12-10 22:14:05.637479-03 | 2025-12-10 22:14:08.664044-03 | 2025-12-10 22:14:08.669906-03 | Client | ClientRead | idle | -8625620423702777529 | WITH status_lista AS ( SELECT unnest(ARRAY[ 'PENDENTE', 'CONCLUIDO', 'EM_PROCESSAMENTO', 'COM_ERRO', 'COM_ERRO_PERMANENTE' ]) AS status ), recorrente_lista AS ( SELECT unnest(ARRAY[true, false]) AS recorrente ), combinacoes AS ( SELECT s.status, r.recorrente FROM status_lista s CROSS JOIN recorrente_lista r ), contagens AS ( SELECT status, recorrente, COUNT(*) AS qtd FROM cfe_periodo_importacao_job WHERE data_fim <= now() AT TIME ZONE 'America/Sao_Paulo' AND status IS NOT NULL AND status IN ('PENDENTE','CONCLUIDO','EM_PROCESSAMENTO','COM_ERRO','COM_ERRO_PERMANENTE') GROUP BY status, recorrente ) SELECT COALESCE(ct.qtd, 0) AS "Qtd", c.status AS "Status", c.recorrente AS "Recorrente" FROM combinacoes c LEFT JOIN contagens ct ON c.status = ct.status AND c.recorrente = ct.recorrente ORDER BY c.status, c.recorrente; | client backend | |||||
| 1665815312 | documents | 23195 | 16402 | postgres | integracao-fluxo-pagamento-worker | 10.0.20.46 | 33459 | 2025-12-10 22:06:05.59553-03 | 2025-12-10 22:16:18.888858-03 | 2025-12-10 22:16:18.908215-03 | 2025-12-10 22:16:18.909641-03 | Client | ClientRead | idle in transaction | 1036011070 | -3066162310059956733 | select gzip, type, key from document where key = $1 and type = $2 and data -> 'procEventoNFe' -> 'retEvento' -> 'infEvento' ->> 'tpEvento' in ($3, $4) | client backend | |||
| 1665815312 | documents | 22805 | 16402 | postgres | cfe-job-download-documentos | 10.0.20.251 | 38569 | 2025-12-10 22:04:07.073059-03 | 2025-12-10 22:15:02.230244-03 | 2025-12-10 22:15:02.231682-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24582 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.84 | 17011 | 2025-12-10 22:15:05.657915-03 | 2025-12-10 22:15:06.747942-03 | 2025-12-10 22:15:06.753661-03 | Client | ClientRead | idle | -8625620423702777529 | WITH status_lista AS ( SELECT unnest(ARRAY[ 'PENDENTE', 'CONCLUIDO', 'EM_PROCESSAMENTO', 'COM_ERRO', 'COM_ERRO_PERMANENTE' ]) AS status ), recorrente_lista AS ( SELECT unnest(ARRAY[true, false]) AS recorrente ), combinacoes AS ( SELECT s.status, r.recorrente FROM status_lista s CROSS JOIN recorrente_lista r ), contagens AS ( SELECT status, recorrente, COUNT(*) AS qtd FROM cfe_periodo_importacao_job WHERE data_fim <= now() AT TIME ZONE 'America/Sao_Paulo' AND status IS NOT NULL AND status IN ('PENDENTE','CONCLUIDO','EM_PROCESSAMENTO','COM_ERRO','COM_ERRO_PERMANENTE') GROUP BY status, recorrente ) SELECT COALESCE(ct.qtd, 0) AS "Qtd", c.status AS "Status", c.recorrente AS "Recorrente" FROM combinacoes c LEFT JOIN contagens ct ON c.status = ct.status AND c.recorrente = ct.recorrente ORDER BY c.status, c.recorrente; | client backend | |||||
| 16450 | fiscal | 22369 | 16402 | postgres | fiscal-intelligence-core-job | 10.0.24.253 | 16979 | 2025-12-10 22:02:05.050537-03 | 2025-12-10 22:16:18.809663-03 | 2025-12-10 22:16:18.810132-03 | 2025-12-10 22:16:18.810133-03 | IO | DataFileRead | active | 1036011070 | -7244585083917778096 | select * from cnpj_consolidation cc where cc.cnpj = $1 | client backend | |||
| 1665815312 | documents | 23125 | 16402 | postgres | mensageria-api | 10.0.20.84 | 59771 | 2025-12-10 22:05:42.794916-03 | 2025-12-10 22:16:08.90414-03 | 2025-12-10 22:16:08.905219-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 23384 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.253 | 15511 | 2025-12-10 22:07:13.701682-03 | 2025-12-10 22:15:49.863205-03 | 2025-12-10 22:15:49.863245-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24747 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.24.185 | 35859 | 2025-12-10 22:16:05.821779-03 | 2025-12-10 22:16:06.681358-03 | 2025-12-10 22:16:06.68575-03 | Client | ClientRead | idle | -6488867169811202377 | WITH numeracoes AS ( SELECT COUNT(CASE WHEN nu.utilizado = 'SIM' THEN 1 END) AS qtd_numeracao_utilizada, COUNT(CASE WHEN nu.utilizado = 'NAO' THEN 1 END) AS qtd_numeracao_disponivel FROM numeracao_utilizada nu JOIN controle_numeracao cn ON nu.controle_numeracao_id = cn.id WHERE cn.id = (SELECT MAX(id) FROM controle_numeracao) ), notas_emitidas AS ( SELECT to_char(data_rps, 'YYYY-MM') AS periodo, COUNT(1) AS quantidade_notas_emitidas FROM dados_emissao_nfse WHERE serie_rps = '01SN' GROUP BY to_char(data_rps, 'YYYY-MM') ORDER BY to_char(data_rps, 'YYYY-MM') DESC LIMIT 1 ) SELECT n.qtd_numeracao_utilizada QtdUtilizada, n.qtd_numeracao_disponivel QtdDisponivel, ne.periodo Periodo, ne.quantidade_notas_emitidas QtdNotasEmitidas FROM numeracoes n CROSS JOIN notas_emitidas ne | client backend | |||||
| 3333716331 | revizia | 24748 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.84 | 44375 | 2025-12-10 22:16:05.999643-03 | 2025-12-10 22:16:06.924001-03 | 2025-12-10 22:16:07.709721-03 | Client | ClientRead | idle | 957357389483338053 | select e.cnpj as CNpj, (dsc is null) as NovaEmpresa, dsc.data_inicio as DataInicio, dsc.data_fim as DataFim from certificado c left join lateral (select ce2.id, ce2.certificado_id, ce2.empresa_id, ce2.created_at from conta_empresa ce2 left join empresa e2 on (ce2.empresa_id = e2.id) where ce2.certificado_id = c.id and ce2.empresa_id = (select e3.id from empresa e3 inner join conta_empresa ce3 on e3.id = ce3.empresa_id inner join certificado c3 on ce3.certificado_id = c3.id where substring(e3.cnpj,1,8) = substring(e2.cnpj,1,8) and c3.data_expiracao > NOW() and e3.tipo_empresa = 'MATRIZ' limit 1) and c.data_expiracao > NOW() and e2.tipo_empresa = 'MATRIZ' order by created_at desc limit 1) ce on (true) left join empresa e on (ce.empresa_id = e.id) left join download_sped_controle_empresa dsc on (dsc.conta_empresa_id = ce.id) where ce.id is not null and e.tipo_empresa = 'MATRIZ' order by (dsc is null), dsc.data_inicio, ce.created_at desc | client backend | |||||
| 16450 | fiscal | 24434 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.251 | 38515 | 2025-12-10 22:14:05.758387-03 | 2025-12-10 22:15:34.634928-03 | 2025-12-10 22:15:34.637155-03 | Client | ClientRead | idle | -6710500507105320500 | INSERT INTO fila_cons_analises (hash_id, cnpj, fila, mensagem, data_criacao) VALUES ($1, $2, $3, $4, $5) | client backend | |||||
| 3333716331 | revizia | 24583 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.24.71 | 37805 | 2025-12-10 22:15:05.937469-03 | 2025-12-10 22:15:06.833033-03 | 2025-12-10 22:15:07.611487-03 | Client | ClientRead | idle | 957357389483338053 | select e.cnpj as CNpj, (dsc is null) as NovaEmpresa, dsc.data_inicio as DataInicio, dsc.data_fim as DataFim from certificado c left join lateral (select ce2.id, ce2.certificado_id, ce2.empresa_id, ce2.created_at from conta_empresa ce2 left join empresa e2 on (ce2.empresa_id = e2.id) where ce2.certificado_id = c.id and ce2.empresa_id = (select e3.id from empresa e3 inner join conta_empresa ce3 on e3.id = ce3.empresa_id inner join certificado c3 on ce3.certificado_id = c3.id where substring(e3.cnpj,1,8) = substring(e2.cnpj,1,8) and c3.data_expiracao > NOW() and e3.tipo_empresa = 'MATRIZ' limit 1) and c.data_expiracao > NOW() and e2.tipo_empresa = 'MATRIZ' order by created_at desc limit 1) ce on (true) left join empresa e on (ce.empresa_id = e.id) left join download_sped_controle_empresa dsc on (dsc.conta_empresa_id = ce.id) where ce.id is not null and e.tipo_empresa = 'MATRIZ' order by (dsc is null), dsc.data_inicio, ce.created_at desc | client backend | |||||
| 3333716331 | revizia | 24435 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.46 | 54027 | 2025-12-10 22:14:05.918739-03 | 2025-12-10 22:14:08.744895-03 | 2025-12-10 22:14:09.525834-03 | Client | ClientRead | idle | 957357389483338053 | select e.cnpj as CNpj, (dsc is null) as NovaEmpresa, dsc.data_inicio as DataInicio, dsc.data_fim as DataFim from certificado c left join lateral (select ce2.id, ce2.certificado_id, ce2.empresa_id, ce2.created_at from conta_empresa ce2 left join empresa e2 on (ce2.empresa_id = e2.id) where ce2.certificado_id = c.id and ce2.empresa_id = (select e3.id from empresa e3 inner join conta_empresa ce3 on e3.id = ce3.empresa_id inner join certificado c3 on ce3.certificado_id = c3.id where substring(e3.cnpj,1,8) = substring(e2.cnpj,1,8) and c3.data_expiracao > NOW() and e3.tipo_empresa = 'MATRIZ' limit 1) and c.data_expiracao > NOW() and e2.tipo_empresa = 'MATRIZ' order by created_at desc limit 1) ce on (true) left join empresa e on (ce.empresa_id = e.id) left join download_sped_controle_empresa dsc on (dsc.conta_empresa_id = ce.id) where ce.id is not null and e.tipo_empresa = 'MATRIZ' order by (dsc is null), dsc.data_inicio, ce.created_at desc | client backend | |||||
| 1665815312 | documents | 24770 | 16402 | postgres | cte-lambda-aws | 10.0.20.251 | 55085 | 2025-12-10 22:16:12.184838-03 | 2025-12-10 22:16:12.85864-03 | 2025-12-10 22:16:12.860776-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24122 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.138 | 21167 | 2025-12-10 22:12:01.734016-03 | 2025-12-10 22:14:01.221419-03 | 2025-12-10 22:14:01.224577-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 12892 | 16402 | postgres | cfe-job-download-documentos | 10.0.20.46 | 23971 | 2025-12-10 21:23:07.07324-03 | 2025-12-10 22:16:17.69915-03 | 2025-12-10 22:16:17.699318-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24455 | 16402 | postgres | econet-scrapper | 10.0.24.253 | 23107 | 2025-12-10 22:14:12.244664-03 | 2025-12-10 22:14:12.27381-03 | 2025-12-10 22:14:12.273827-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 3333716331 | revizia | 24456 | 16402 | postgres | nfe-lambda-aws | 10.0.20.84 | 19205 | 2025-12-10 22:14:12.801337-03 | 2025-12-10 22:14:12.819397-03 | 2025-12-10 22:14:12.819458-03 | Client | ClientRead | idle | -5084201902893922806 | SELECT ce.conta_id FROM conta_empresa ce INNER JOIN empresa e ON ce.empresa_id = e.id INNER JOIN conta c on ce.conta_id = c.id WHERE e.cnpj IN ($1, $2) AND c.status = 'ATIVO' AND c.id <> 1 LIMIT 1 | client backend | |||||
| 1665815312 | documents | 24635 | 16402 | postgres | document-api | 10.0.20.84 | 47103 | 2025-12-10 22:15:25.039167-03 | 2025-12-10 22:15:40.98312-03 | 2025-12-10 22:15:40.983331-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 22278 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.185 | 18039 | 2025-12-10 22:01:32.072652-03 | 2025-12-10 22:16:17.206034-03 | 2025-12-10 22:16:17.206175-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24127 | 16402 | postgres | nfe-lambda-aws | 10.0.20.84 | 53317 | 2025-12-10 22:12:03.557172-03 | 2025-12-10 22:16:05.387336-03 | 2025-12-10 22:16:05.389609-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24126 | 16402 | postgres | nfe-lambda-aws | 10.0.20.251 | 51395 | 2025-12-10 22:12:03.28058-03 | 2025-12-10 22:15:46.447221-03 | 2025-12-10 22:15:46.449758-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 23521 | 16402 | postgres | mensageria-api | 10.0.24.138 | 62565 | 2025-12-10 22:08:06.127198-03 | 2025-12-10 22:16:14.150477-03 | 2025-12-10 22:16:14.150538-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24298 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.84 | 61903 | 2025-12-10 22:13:05.83826-03 | 2025-12-10 22:15:43.667544-03 | 2025-12-10 22:15:43.668429-03 | Client | ClientRead | idle | -6488867169811202377 | select id, type, file_name from book_keeping where status in ('READING','READING_WITH_PRIORITY') order by created_at, updated_at | client backend | |||||
| 1665815312 | documents | 24627 | 16402 | postgres | mensageria-api | 10.0.24.185 | 34853 | 2025-12-10 22:15:23.264288-03 | 2025-12-10 22:15:47.389498-03 | 2025-12-10 22:15:47.390853-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 21278 | 16402 | postgres | nfe-lambda-aws | 10.0.24.81 | 16645 | 2025-12-10 21:57:02.665105-03 | 2025-12-10 22:14:42.688844-03 | 2025-12-10 22:14:42.691173-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 22396 | 16402 | postgres | mensageria-api | 10.0.20.84 | 58805 | 2025-12-10 22:02:10.974025-03 | 2025-12-10 22:16:11.6557-03 | 2025-12-10 22:16:11.65682-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 16450 | fiscal | 24642 | 16402 | postgres | econet-scrapper | 10.0.24.185 | 52195 | 2025-12-10 22:15:28.850494-03 | 2025-12-10 22:15:28.866068-03 | 2025-12-10 22:15:28.866083-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 16450 | fiscal | 24467 | 16402 | postgres | econet-scrapper | 10.0.24.71 | 17267 | 2025-12-10 22:14:19.298288-03 | 2025-12-10 22:14:19.314883-03 | 2025-12-10 22:14:19.314891-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 1665815312 | documents | 24461 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.71 | 23917 | 2025-12-10 22:14:14.816826-03 | 2025-12-10 22:16:17.647518-03 | 2025-12-10 22:16:17.647564-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24778 | 16402 | postgres | cte-lambda-aws | 10.0.20.84 | 50093 | 2025-12-10 22:16:16.123184-03 | 2025-12-10 22:16:16.46738-03 | 2025-12-10 22:16:16.469454-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24782 | 16402 | postgres | cte-lambda-aws | 10.0.24.71 | 7113 | 2025-12-10 22:16:18.565988-03 | 2025-12-10 22:16:18.82294-03 | 2025-12-10 22:16:18.824087-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24637 | 16402 | postgres | core-api | 10.0.24.185 | 7895 | 2025-12-10 22:15:27.20794-03 | 2025-12-10 22:15:46.297846-03 | 2025-12-10 22:15:46.297881-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 21577 | 16402 | postgres | nfe-lambda-aws | 10.0.24.185 | 25739 | 2025-12-10 21:58:50.847161-03 | 2025-12-10 22:16:15.761515-03 | 2025-12-10 22:16:15.763923-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 16384 | rdsadmin | 16273 | 10 | rdsadmin | PostgreSQL JDBC Driver | -1 | 2025-11-26 22:31:10.413433-03 | 2025-12-10 22:16:07.010427-03 | 2025-12-10 22:16:07.010449-03 | Client | ClientRead | idle | 3326913007740874862 | SELECT value FROM rds_heartbeat2 | client backend | ||||||
| 1665815312 | documents | 24468 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.253 | 62171 | 2025-12-10 22:14:19.864356-03 | 2025-12-10 22:16:18.86323-03 | 2025-12-10 22:16:18.863275-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 18074 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.138 | 34939 | 2025-12-10 21:42:12.75945-03 | 2025-12-10 22:15:13.64687-03 | 2025-12-10 22:15:13.647072-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 23563 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.24.138 | 9631 | 2025-12-10 22:08:24.34843-03 | 2025-12-10 22:14:13.180297-03 | 2025-12-10 22:14:13.180349-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 16450 | fiscal | 19509 | 16402 | postgres | processador-linhas-sped-job | 10.0.20.84 | 32331 | 2025-12-10 21:48:33.819035-03 | 2025-12-10 22:14:55.248894-03 | 2025-12-10 22:14:55.248965-03 | Client | ClientRead | idle | -4199849316459484872 | DISCARD ALL; | client backend | |||||
| 16450 | fiscal | 24129 | 16402 | postgres | postgres_fdw | 127.0.0.1 | 20652 | 2025-12-10 22:12:03.620117-03 | 2025-12-10 22:16:09.753311-03 | 2025-12-10 22:16:09.753328-03 | Client | ClientRead | idle | -4518006279650829961 | ABORT TRANSACTION | client backend | |||||
| 16451 | cloudworks | 21958 | 16402 | postgres | 2025-12-10 22:00:00.040306-03 | 2025-12-10 22:16:14.015502-03 | 2025-12-10 22:00:00.041678-03 | 2025-12-10 22:00:00.041678-03 | Timeout | PgSleep | active | 1036070717 | 1036011070 | -8048468118488788623 | CALL af2.atualizaestatisticas( 0, 50000000, 5000000, 99999999999, 0, 99999999999, 0, '', 5, 300, 0, '' ) | pg_cron | |||||
| 1665815312 | documents | 19527 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.20.46 | 31465 | 2025-12-10 21:48:39.540601-03 | 2025-12-10 22:16:18.646436-03 | 2025-12-10 22:16:18.646508-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 22863 | 16402 | postgres | cfe-job-queue-api | 10.0.20.84 | 35539 | 2025-12-10 22:04:23.705781-03 | 2025-12-10 22:16:14.152798-03 | 2025-12-10 22:16:14.152871-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 23408 | 16402 | postgres | cfe-job-download-documentos | 10.0.20.251 | 18599 | 2025-12-10 22:07:26.182962-03 | 2025-12-10 22:16:18.571408-03 | 2025-12-10 22:16:18.571492-03 | Client | ClientRead | idle | client backend | |||||||
| 3333716331 | revizia | 24638 | 16402 | postgres | core-api | 10.0.20.46 | 40263 | 2025-12-10 22:15:27.212287-03 | 2025-12-10 22:16:09.761009-03 | 2025-12-10 22:16:09.761118-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24653 | 16402 | postgres | mensageria-api | 10.0.24.185 | 43265 | 2025-12-10 22:15:34.076021-03 | 2025-12-10 22:15:50.093944-03 | 2025-12-10 22:15:50.09514-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24657 | 16402 | postgres | core-api | 10.0.24.138 | 39759 | 2025-12-10 22:15:34.183357-03 | 2025-12-10 22:15:46.286544-03 | 2025-12-10 22:15:46.286604-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 16450 | fiscal | 24072 | 16402 | postgres | processador-linhas-sped-api | 10.0.24.71 | 23755 | 2025-12-10 22:11:42.628224-03 | 2025-12-10 22:16:14.151063-03 | 2025-12-10 22:16:14.151137-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 23578 | 16402 | postgres | nfe-lambda-aws | 10.0.24.253 | 20955 | 2025-12-10 22:08:33.99685-03 | 2025-12-10 22:16:16.899997-03 | 2025-12-10 22:16:16.902964-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 13020 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.81 | 44161 | 2025-12-10 21:23:32.373283-03 | 2025-12-10 22:16:18.582633-03 | 2025-12-10 22:16:18.582714-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24659 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.24.138 | 2781 | 2025-12-10 22:15:35.734861-03 | 2025-12-10 22:15:35.753186-03 | 2025-12-10 22:15:35.755036-03 | Client | ClientRead | idle | -6710500507105320500 | INSERT INTO fila_cons_analises (hash_id, cnpj, fila, mensagem, data_criacao) VALUES ($1, $2, $3, $4, $5) | client backend | |||||
| 3333716331 | revizia | 24511 | 16402 | postgres | certificado-api | 10.0.24.253 | 17845 | 2025-12-10 22:14:40.650649-03 | 2025-12-10 22:16:09.371905-03 | 2025-12-10 22:16:09.371931-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 1665815312 | documents | 21833 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.71 | 59899 | 2025-12-10 21:59:38.653156-03 | 2025-12-10 22:16:18.843335-03 | 2025-12-10 22:16:18.843341-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24171 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.20.84 | 10793 | 2025-12-10 22:12:16.865048-03 | 2025-12-10 22:16:17.880656-03 | 2025-12-10 22:16:17.880726-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 23579 | 16402 | postgres | nfe-lambda-aws | 10.0.24.138 | 15533 | 2025-12-10 22:08:34.144601-03 | 2025-12-10 22:16:17.218525-03 | 2025-12-10 22:16:17.220854-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24677 | 16402 | postgres | mensageria-api | 10.0.20.46 | 25931 | 2025-12-10 22:15:39.200104-03 | 2025-12-10 22:15:50.095482-03 | 2025-12-10 22:15:50.09675-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24666 | 16402 | postgres | core-api | 10.0.24.253 | 19165 | 2025-12-10 22:15:38.01718-03 | 2025-12-10 22:15:49.006497-03 | 2025-12-10 22:15:49.006539-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24668 | 16402 | postgres | core-api | 10.0.20.84 | 25037 | 2025-12-10 22:15:38.028391-03 | 2025-12-10 22:15:49.006939-03 | 2025-12-10 22:15:49.007135-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24163 | 16402 | postgres | core-api | 10.0.24.71 | 37429 | 2025-12-10 22:12:15.109117-03 | 2025-12-10 22:15:48.980697-03 | 2025-12-10 22:15:48.980725-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 22903 | 16402 | postgres | cfe-job-download-documentos | 10.0.20.84 | 20733 | 2025-12-10 22:04:33.073553-03 | 2025-12-10 22:16:18.07196-03 | 2025-12-10 22:16:18.072041-03 | Client | ClientRead | idle | client backend | |||||||
| 3333716331 | revizia | 23720 | 16402 | postgres | mensageria-api | 10.0.20.84 | 3673 | 2025-12-10 22:09:23.743621-03 | 2025-12-10 22:16:14.155769-03 | 2025-12-10 22:16:14.155811-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 21602 | 16402 | postgres | mensageria-api | 10.0.20.251 | 10231 | 2025-12-10 21:58:55.416791-03 | 2025-12-10 22:16:10.647256-03 | 2025-12-10 22:16:10.647262-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24667 | 16402 | postgres | core-api | 10.0.24.138 | 37389 | 2025-12-10 22:15:38.031524-03 | 2025-12-10 22:15:46.257713-03 | 2025-12-10 22:15:46.257759-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 24669 | 16402 | postgres | core-api | 10.0.20.46 | 6283 | 2025-12-10 22:15:38.041522-03 | 2025-12-10 22:16:18.124121-03 | 2025-12-10 22:16:18.12419-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 1665815312 | documents | 24335 | 16402 | postgres | document-api | 10.0.24.71 | 52955 | 2025-12-10 22:13:22.570784-03 | 2025-12-10 22:15:13.77248-03 | 2025-12-10 22:15:13.772522-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24673 | 16402 | postgres | econet-scrapper | 10.0.20.46 | 6579 | 2025-12-10 22:15:38.673701-03 | 2025-12-10 22:15:38.69291-03 | 2025-12-10 22:15:38.692919-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 1665815312 | documents | 22414 | 16402 | postgres | mensageria-api | 10.0.24.253 | 63777 | 2025-12-10 22:02:18.749131-03 | 2025-12-10 22:16:08.905826-03 | 2025-12-10 22:16:08.907091-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 19565 | 16402 | postgres | mensageria-api | 10.0.24.81 | 29037 | 2025-12-10 21:48:49.853485-03 | 2025-12-10 22:15:39.489101-03 | 2025-12-10 22:15:39.489187-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 21969 | 16402 | postgres | download-document-api | 10.0.24.81 | 40055 | 2025-12-10 22:00:00.764996-03 | 2025-12-10 22:16:09.547936-03 | 2025-12-10 22:16:09.552644-03 | 2025-12-10 22:16:09.552659-03 | Client | ClientRead | idle in transaction | 1036011070 | -8328895792785131048 | select configurac0_.id as id1_36_, configurac0_.ativa as ativa2_36_, configurac0_.descricao as descrica3_36_, configurac0_.grupo as grupo4_36_, configurac0_.habilitar_taxa_selic as habilita5_36_, configurac0_.nome_atributo_consolidacao as nome_atr6_36_, configurac0_.nome_fila as nome_fil7_36_, configurac0_.origem_contribuicoes as origem_c8_36_, configurac0_.origem_ecd as origem_e9_36_, configurac0_.origem_ecf as origem_10_36_, configurac0_.origem_esocial as origem_11_36_, configurac0_.origem_icms_ipi as origem_12_36_, configurac0_.origem_xml as origem_13_36_, configurac0_.tipo_consolidacao as tipo_co14_36_, configurac0_.tipo_imposto as tipo_im15_36_, configurac0_.tipo_tese as tipo_te16_36_, configurac0_.versao_consolidacao as versao_17_36_, configurac0_.vigencia_final as vigenci18_36_, configurac0_.vigencia_inicial as vigenci19_36_ from configuracao_consolidacao configurac0_ where configurac0_.tipo_consolidacao=$1 | client backend | |||
| 16450 | fiscal | 24777 | 16402 | postgres | econet-scrapper | 10.0.20.46 | 23407 | 2025-12-10 22:16:14.673545-03 | 2025-12-10 22:16:14.693237-03 | 2025-12-10 22:16:14.693259-03 | Client | ClientRead | idle | 4808936042342407727 | SET application_name = 'econet-scrapper' | client backend | |||||
| 1665815312 | documents | 24780 | 16402 | postgres | document-api | 10.0.20.46 | 31265 | 2025-12-10 22:16:16.888143-03 | 2025-12-10 22:16:18.911797-03 | 2025-12-10 22:16:18.912969-03 | 2025-12-10 22:16:18.91297-03 | active | 1036011070 | -6815546958608512757 | select * from pg_stat_activity | client backend | |||||
| 16450 | fiscal | 24167 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.24.81 | 55083 | 2025-12-10 22:12:16.565378-03 | 2025-12-10 22:14:24.148789-03 | 2025-12-10 22:14:24.148847-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 3333716331 | revizia | 24179 | 16402 | postgres | nfe-lambda-aws | 10.0.24.185 | 19625 | 2025-12-10 22:12:20.71617-03 | 2025-12-10 22:14:42.640026-03 | 2025-12-10 22:14:42.640067-03 | Client | ClientRead | idle | -5084201902893922806 | SELECT ce.conta_id FROM conta_empresa ce INNER JOIN empresa e ON ce.empresa_id = e.id INNER JOIN conta c on ce.conta_id = c.id WHERE e.cnpj IN ($1, $2) AND c.status = 'ATIVO' AND c.id <> 1 LIMIT 1 | client backend | |||||
| 16450 | fiscal | 24170 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.24.253 | 39811 | 2025-12-10 22:12:16.795988-03 | 2025-12-10 22:16:14.581152-03 | 2025-12-10 22:16:14.581214-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24175 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.81 | 54489 | 2025-12-10 22:12:19.326957-03 | 2025-12-10 22:16:18.325878-03 | 2025-12-10 22:16:18.325967-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24482 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.20.251 | 12321 | 2025-12-10 22:14:24.425851-03 | 2025-12-10 22:14:24.678197-03 | 2025-12-10 22:14:24.678259-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 3333716331 | revizia | 24718 | 16402 | postgres | rvz-sintegra-job | 10.0.24.185 | 35489 | 2025-12-10 22:15:56.533402-03 | 2025-12-10 22:16:10.698619-03 | 2025-12-10 22:16:10.698725-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 9025 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.138 | 30947 | 2025-12-10 21:09:35.018315-03 | 2025-12-10 22:16:18.699803-03 | 2025-12-10 22:16:18.699896-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 24176 | 16402 | postgres | integracao-fluxo-pagamento-worker | 10.0.24.185 | 25915 | 2025-12-10 22:12:19.444588-03 | 2025-12-10 22:16:17.630354-03 | 2025-12-10 22:16:17.630394-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 16450 | fiscal | 27649 | 16402 | postgres | fiscal-intelligence-core-job | 10.0.20.251 | 63813 | 2025-12-10 20:19:28.339279-03 | 2025-12-10 20:19:28.613069-03 | 2025-12-10 21:49:00.603067-03 | 2025-12-10 21:49:00.60307-03 | Extension | Extension | active | 1036011070 | 1036011070 | -1015899014351333281 | SELECT * FROM ( SELECT CASE WHEN substring(item.produto -> 'prod' ->> 'cfop', 1, 1) IN ('1', '2', '3') THEN 'DEVOLUCAO' WHEN substring(item.produto -> 'prod' ->> 'cfop', 1, 1) IN ('5', '6', '7') THEN 'VENDA' ELSE 'DESCONHECIDO' END AS tipoOperacao, d.imported_at, d.type, TO_CHAR(d.data_emissao, 'YYYY-MM') AS periodo, item.produto -> 'prod' ->> 'cfop' AS cfop, CAST(taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) AS numeric) AS taxaSelicAcumulada, CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' AS numeric) AS valorBaseCalculoPis, CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' AS numeric) AS valorPis, CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vbc' AS numeric) AS valorBaseCalculoCofins, CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' AS numeric) AS valorCofins, d.key, d.data -> 'nfe' -> 'infNFe' -> 'ide' ->> 'nnf' AS number, d.data -> 'nfe' -> 'infNFe' -> 'ide' ->> 'serie' AS serie, d.data -> 'nfe' -> 'infNFe' -> 'dest' ->> 'cnpj' AS cnpjDestinatario, ds.status AS situacao, item.produto -> 'prod' ->> 'cprod' AS codigoProduto, item.produto -> 'prod' ->> 'xprod' AS descricaoProduto, CAST(item.produto -> 'prod' ->> 'vprod' AS numeric) AS valorProduto, CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' AS numeric) AS aliquotaPis, CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' AS numeric) AS aliquotaCofins, ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as novaBaseCalculo, (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as valorDiferencaBasePis, (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as valorDiferencaBaseCofins, (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) / 100)) as valorPisAposExclusao, (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) / 100)) as valorCofinsAposExclusao, (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) / 100))) as valorDiferencaPis, (((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) / 100))) as valorDiferencaCofins, cast((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) / 100))) * (taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) / 100) + (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) / 100))) as numeric) as valorCorrigidoPis, cast((((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) / 100))) * (taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) / 100) + (((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * ((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) / 100))) as numeric) as valorCorrigidoCofins FROM documents_document d INNER JOIN documents_document_status ds ON d.key = ds.key AND d.cnpj_issuer = ds.cnpj_issuer AND d.protocol = ds.protocol AND d.nsu = ds.nsu AND d.type = ds.type, jsonb_array_elements(d.data -> 'nfe' -> 'infNFe' -> 'det') WITH ORDINALITY item(produto) WHERE ds.status = '1' AND d.cnpj_issuer = $1 AND d.type IN ('NFE_4_0', 'NFE_3_1') AND item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'cst' = '01' AND item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'cst' = '01' AND d.data_emissao BETWEEN CAST($2 AS timestamptz) and CAST($3 AS timestamptz) UNION ALL SELECT CASE WHEN substring(item.produto -> 'prod' ->> 'cfop', 1, 1) IN ('1', '2', '3') THEN 'DEVOLUCAO' WHEN substring(item.produto -> 'prod' ->> 'cfop', 1, 1) IN ('5', '6', '7') THEN 'VENDA' ELSE 'DESCONHECIDO' END AS tipoOperacao, d.imported_at, d.type, TO_CHAR(d.data_emissao, 'YYYY-MM-DD') AS periodo, item.produto -> 'prod' ->> 'cfop' AS cfop, CAST(taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) AS numeric) AS taxaSelicAcumulada, CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' AS numeric) AS valorBaseCalculoPis, CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' AS numeric) AS valorPis, CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vbc' AS numeric) AS valorBaseCalculoCofins, CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' AS numeric) AS valorCofins, d.key, d.info ->> 'nCFe' AS number, d.info ->> 'serieSAT' AS serie, d.info ->> 'addresseeCnpj' AS cnpjDestinatario, ds.status AS situacao, item.produto -> 'prod' ->> 'cprod' AS codigoProduto, item.produto -> 'prod' ->> 'xprod' AS descricaoProduto, CAST(item.produto -> 'prod' ->> 'vprod' AS numeric) AS valorProduto, CASE WHEN d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' THEN CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' AS numeric) * 100 ELSE CAST(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' AS numeric) END AS aliquotaPis, CASE WHEN d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' THEN CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' AS numeric) * 100 ELSE CAST(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' AS numeric) END AS aliquotaCofins, ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as novaBaseCalculo, (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as valorDiferencaBasePis, (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) as valorDiferencaBaseCofins, ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) end)) / 100) as valorPisAposExclusao, ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) end)) / 100) as valorCofinsAposExclusao, (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) end)) / 100)) as valorDiferencaPis, (((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) end)) / 100)) as valorDiferencaCofins, cast((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) end)) / 100)) * (taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) / 100) + (((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'ppis' as numeric)) end)) / 100)) as numeric) valorCorrigidoPis, cast((((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) end)) / 100)) * (taxa_selic_acumulada(TO_CHAR(d.data_emissao, 'YYYY-MM')) / 100) + (((cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric))) - ((((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vbc' as numeric)) - ((cast(item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'vpis' as numeric)) + (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'vcofins' as numeric)))) * (case when d.data -> 'infCFe' -> 'ide' ->> 'cuf' = '35' then (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) * 100 else (cast(item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'pcofins' as numeric)) end)) / 100)) as numeric) as valorCorrigidoCofins FROM documents_document d INNER JOIN documents_document_status ds ON d.key = ds.key AND d.cnpj_issuer = ds.cnpj_issuer AND d.protocol = ds.protocol AND d.nsu = ds.nsu AND d.type = ds.type, jsonb_array_elements(d.data -> 'infCFe' -> 'det') WITH ORDINALITY item(produto) WHERE ds.status = '1' AND d.cnpj_issuer = $4 AND d.type IN ('CFE_0_6', 'CFE_00_6', 'CFE_0_7', 'CFE_00_7', 'CFE_0_8', 'CFE_0_9', 'CFE_0_10') AND item.produto -> 'imposto' -> 'pis' -> 'pisAliq' ->> 'cst' = '01' AND item.produto -> 'imposto' -> 'cofins' -> 'cofinsAliq' ->> 'cst' = '01' AND d.data_emissao BETWEEN CAST($5 AS timestamptz) and CAST($6 AS timestamptz) ) resultado ORDER BY resultado.periodo, resultado.imported_at limit $7 offset $8 | client backend | ||
| 5 | postgres | 18331 | 16402 | postgres | pgAdmin 4 - DB:postgres | 10.0.28.38 | 51668 | 2025-12-10 17:14:19.442783-03 | 2025-12-10 17:14:39.028522-03 | 2025-12-10 17:14:39.028728-03 | Client | ClientRead | idle | 5361310776981672498 | SELECT CASE WHEN (SELECT count(extname) FROM pg_catalog.pg_extension WHERE extname='bdr') > 0 THEN 'pgd' WHEN (SELECT COUNT(*) FROM pg_replication_slots) > 0 THEN 'log' ELSE NULL END as type; | client backend | |||||
| 16450 | fiscal | 23424 | 16402 | postgres | esocial-totalizador-fgts-empregador-importar-from-sqs | 10.0.20.251 | 6211 | 2025-12-10 22:07:35.981103-03 | 2025-12-10 22:16:11.37033-03 | 2025-12-10 22:16:11.370347-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24690 | 16402 | postgres | nfe-lambda-aws | 10.0.20.251 | 8485 | 2025-12-10 22:15:46.409673-03 | 2025-12-10 22:16:17.039301-03 | 2025-12-10 22:16:17.042105-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 23636 | 16402 | postgres | mensageria-api | 10.0.24.253 | 23219 | 2025-12-10 22:08:53.212388-03 | 2025-12-10 22:16:11.87505-03 | 2025-12-10 22:16:11.875056-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 16451 | cloudworks | 6358 | 16402 | postgres | 2025-12-10 21:00:00.004024-03 | 2025-12-10 22:16:13.50414-03 | 2025-12-10 21:00:00.005133-03 | 2025-12-10 21:00:00.005133-03 | Timeout | PgSleep | active | 1036070713 | 1036011070 | 9207317994208447636 | CALL af2.atualizaestatisticas( 0, 5000000, 50000, 99999999999, 0, 99999999999, 0, '', 5, 300, 0, '' ) | pg_cron | |||||
| 3333716331 | revizia | 23446 | 16402 | postgres | esocial-totalizador-fgts-empregador-importar-from-sqs | 10.0.24.138 | 15771 | 2025-12-10 22:07:43.348728-03 | 2025-12-10 22:16:11.196745-03 | 2025-12-10 22:16:11.19678-03 | Client | ClientRead | idle | client backend | |||||||
| 3333716331 | revizia | 24344 | 16402 | postgres | rvz-sintegra-job | 10.0.20.84 | 23529 | 2025-12-10 22:13:26.487144-03 | 2025-12-10 22:14:10.632255-03 | 2025-12-10 22:14:10.63233-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 21222 | 16402 | postgres | nfe-lambda-aws | 10.0.20.46 | 28919 | 2025-12-10 21:56:45.308837-03 | 2025-12-10 22:16:05.743862-03 | 2025-12-10 22:16:05.745229-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 23447 | 16402 | postgres | esocial-totalizador-fgts-empregador-importar-from-sqs | 10.0.20.84 | 22187 | 2025-12-10 22:07:43.348998-03 | 2025-12-10 22:16:11.197354-03 | 2025-12-10 22:16:11.197482-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 27653 | 16402 | postgres | postgres_fdw | 127.0.0.1 | 22750 | 2025-12-10 20:19:28.84038-03 | 2025-12-10 20:19:28.846886-03 | 2025-12-10 22:16:18.913024-03 | 2025-12-10 22:16:18.913024-03 | active | 1036011035 | 5607492908728616596 | FETCH 100 FROM c12 | client backend | |||||
| 3333716331 | revizia | 24345 | 16402 | postgres | rvz-sintegra-job | 10.0.20.46 | 57767 | 2025-12-10 22:13:26.501667-03 | 2025-12-10 22:15:27.00493-03 | 2025-12-10 22:15:27.005066-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 22082 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.20.46 | 46991 | 2025-12-10 22:00:32.566421-03 | 2025-12-10 22:16:09.568787-03 | 2025-12-10 22:16:09.570367-03 | Client | ClientRead | idle | 2584226270632227960 | DELETE FROM fila_cons_analises WHERE hash_id = $1 | client backend | |||||
| 1665815312 | documents | 24707 | 16402 | postgres | document-api | 10.0.24.253 | 7255 | 2025-12-10 22:15:52.175898-03 | 2025-12-10 22:16:17.726594-03 | 2025-12-10 22:16:17.726654-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24201 | 16402 | postgres | fiscal-intelligence-api | 10.0.20.46 | 55087 | 2025-12-10 22:12:29.083266-03 | 2025-12-10 22:16:09.770168-03 | 2025-12-10 22:16:09.778112-03 | 2025-12-10 22:16:09.778113-03 | IO | DataFileRead | active | 1036011070 | -6371721927676092321 | SELECT periodo, codigo, nome, codigoNcm, descricaoUnidadeMedida, quantidade, valor FROM ( SELECT periodo, codigo, nome, codigoNcm, descricaoUnidadeMedida, SUM(quantidade) as quantidade, SUM(valor) as valor, ROW_NUMBER() over ( partition by periodo order by periodo, SUM(valor) desc ) as rank FROM ( SELECT periodo, codigo, nome, codigoNcm, descricaoUnidadeMedida, quantidade, valor, indicador_entrada_terceiro FROM ( SELECT bk.period as periodo , bklC170.json_line ->> 'cod_item' as codigo , CASE WHEN (bklC170.json_line ->> 'descr_compl' IS NOT NULL AND bklC170.json_line ->> 'descr_compl' <> '') THEN bklC170.json_line ->> 'descr_compl' ELSE bkl0200.json_line ->> 'descricao_item' END nome , bkl0200.json_line ->> 'codigo_ncm' as codigoNcm , bkl0190.json_line ->> 'descricao_unidade_medida' as descricaoUnidadeMedida , CAST(bklC170.json_line ->> 'qtd' AS NUMERIC) as quantidade , CAST(bklC170.json_line ->> 'vl_item' AS NUMERIC) as valor , ( SELECT count(*) FROM book_keeping_line bklC100 WHERE bklC100.cnpj_raiz = SUBSTRING($1, 1, 8) AND bklC100.identifier = 'C100' AND bklC100.json_line ->> 'indicador_operacao' = 'ENTRADA' AND bklC100.json_line ->> 'indicador_emitente' = 'TERCEIROS' AND bklC100.id = bklC170.parent_line_id ) as indicador_entrada_terceiro FROM book_keeping bk INNER JOIN book_keeping_line bklC170 ON bk.id = bklC170.book_keeping_id LEFT OUTER JOIN book_keeping_line bkl0200 ON bk.id = bkl0200.book_keeping_id LEFT OUTER JOIN book_keeping_line bkl0190 ON bk.id = bkl0190.book_keeping_id WHERE bklC170.cnpj_raiz = SUBSTRING($2, 1, 8) AND bkl0200.cnpj_raiz = SUBSTRING($3, 1, 8) AND bkl0190.cnpj_raiz = SUBSTRING($4, 1, 8) AND bk.id IN ($5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $60, $61) AND bklC170.identifier = 'C170' AND bkl0200.identifier = '0200' AND bkl0190.identifier = '0190' AND bklC170.json_line ->> 'cod_item' = bkl0200.json_line ->> 'codigo_item' AND bkl0190.json_line ->> 'unidade_medida' = bkl0200.json_line ->> 'unidade_medida' AND bklC170.json_line ->> 'cfop' IN ( '1101','1102','1111','1113','1116','1117','1118','1120','1121','1122','1126','1251','1252','1253','1254','1255','1256','1257','1401','1403','1406','1407','1551','1556','1651','1652','1653','1949','1151','1152','1153','1154','1408','1409','1552','1557', '2101','2102','2111','2113','2116','2117','2118','2120','2121','2122','2126','2151','2152','2153','2154','2251','2252','2253','2254','2255','2256','2257','2401','2403','2406','2407','2408','2409','2551','2556','2651','2652','2653','2949', '3100','3101','3102','3126','3127','3251','3551','3556','3651','3652','3653','3949' ) ) indicador WHERE indicador_entrada_terceiro > 0 ) indicador GROUP BY periodo, codigo, nome, codigoNcm, descricaoUnidadeMedida ORDER BY periodo, valor DESC ) produtos WHERE rank <= $62 | client backend | |||
| 3333716331 | revizia | 24197 | 16402 | postgres | core-api | 10.0.24.71 | 42701 | 2025-12-10 22:12:27.371553-03 | 2025-12-10 22:15:49.006229-03 | 2025-12-10 22:15:49.006259-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 3333716331 | revizia | 23459 | 16402 | postgres | certificado-api | 10.0.20.46 | 55217 | 2025-12-10 22:07:47.255094-03 | 2025-12-10 22:16:10.698847-03 | 2025-12-10 22:16:10.698958-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 10241 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.20.251 | 8447 | 2025-12-10 21:13:55.739502-03 | 2025-12-10 22:14:49.745988-03 | 2025-12-10 22:14:49.746106-03 | Client | ClientRead | idle | client backend | |||||||
| 16384 | rdsadmin | 16592 | 10 | rdsadmin | -1 | 2025-11-26 22:31:58.583641-03 | 2025-12-10 22:16:17.997305-03 | 2025-12-10 22:16:17.997353-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||||
| 16450 | fiscal | 24206 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.24.138 | 39641 | 2025-12-10 22:12:31.971876-03 | 2025-12-10 22:14:16.019681-03 | 2025-12-10 22:14:16.019689-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 1665815312 | documents | 23180 | 16402 | postgres | download-document-api | 10.0.24.185 | 44443 | 2025-12-10 22:06:00.012879-03 | 2025-12-10 22:16:06.537227-03 | 2025-12-10 22:16:06.539061-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24228 | 16402 | postgres | ecac-situacao-fiscal-api | 10.0.20.251 | 33227 | 2025-12-10 22:12:40.586761-03 | 2025-12-10 22:14:40.650271-03 | 2025-12-10 22:14:40.650318-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 18245 | 16402 | postgres | cfe-job-download-documentos-recorrentes | 10.0.24.71 | 28537 | 2025-12-10 21:42:57.647941-03 | 2025-12-10 22:14:14.815582-03 | 2025-12-10 22:14:14.815784-03 | Client | ClientRead | idle | client backend | |||||||
| 16450 | fiscal | 24486 | 16402 | postgres | fiscal-intelligence-sped-job | 10.0.24.71 | 39825 | 2025-12-10 22:14:28.317153-03 | 2025-12-10 22:16:18.853988-03 | 2025-12-10 22:16:18.853998-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 1665815312 | documents | 24514 | 16402 | postgres | nfe-lambda-aws | 10.0.24.253 | 35975 | 2025-12-10 22:14:42.233792-03 | 2025-12-10 22:14:42.365957-03 | 2025-12-10 22:14:42.368221-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 1665815312 | documents | 24373 | 16402 | postgres | nfe-lambda-aws | 10.0.24.71 | 5203 | 2025-12-10 22:13:40.148116-03 | 2025-12-10 22:16:06.523245-03 | 2025-12-10 22:16:06.524605-03 | Client | ClientRead | idle | 3694949039461716331 | COMMIT | client backend | |||||
| 16450 | fiscal | 23759 | 16402 | postgres | fiscal-intelligence-api | 10.0.24.81 | 24735 | 2025-12-10 22:09:38.322363-03 | 2025-12-10 22:16:11.784886-03 | 2025-12-10 22:16:11.784983-03 | Client | ClientRead | idle | 7088996947831101750 | ROLLBACK | client backend | |||||
| 16451 | cloudworks | 20445 | 16402 | postgres | 2025-12-10 20:00:00.006342-03 | 2025-12-10 22:16:18.126483-03 | 2025-12-10 20:00:00.008028-03 | 2025-12-10 20:00:00.008029-03 | Timeout | PgSleep | active | 1036070732 | 1036011070 | 6950012875221666630 | CALL af2.atualizaestatisticas( 0, 50000, 0, 99999999999, 0, 99999999999, 0, '', 5, 300, 0, '' ) | pg_cron | |||||
| 1665815312 | documents | 23799 | 16402 | postgres | cfe-job-download-documentos | 10.0.24.71 | 48357 | 2025-12-10 22:09:53.845092-03 | 2025-12-10 22:16:18.843128-03 | 2025-12-10 22:16:18.843163-03 | Client | ClientRead | idle | client backend | |||||||
| 1665815312 | documents | 23764 | 16402 | postgres | download-document-api | 10.0.24.185 | 34601 | 2025-12-10 22:09:41.45244-03 | 2025-12-10 22:16:16.621189-03 | 2025-12-10 22:16:16.621254-03 | Client | ClientRead | idle | ROLLBACK | client backend | ||||||
| 16450 | fiscal | 24556 | 16402 | postgres | processador-linhas-sped-job | 10.0.20.84 | 14987 | 2025-12-10 22:14:55.246309-03 | 2025-12-10 22:16:14.051262-03 | 2025-12-10 22:16:18.910348-03 | 2025-12-10 22:16:18.910409-03 | Client | ClientRead | idle in transaction | 1036070718 | 1036011070 | -4716436261144713742 | select nextval ('sequence_book_keeping_line') | client backend | ||
| 16450 | fiscal | 24520 | 16402 | postgres | lambda-go-revizia-metrics | 10.0.24.253 | 55829 | 2025-12-10 22:14:43.65516-03 | 2025-12-10 22:14:43.671767-03 | 2025-12-10 22:14:43.673882-03 | Client | ClientRead | idle | -6488867169811202377 | select id, type, file_name from book_keeping where status in ('READING','READING_WITH_PRIORITY') order by created_at, updated_at | client backend | |||||
| 3333716331 | revizia | 24541 | 16402 | postgres | go-document-webhook-load | 10.0.20.46 | 11863 | 2025-12-10 22:14:50.789372-03 | 2025-12-10 22:14:50.809725-03 | 2025-12-10 22:14:50.812205-03 | Client | ClientRead | idle | 7742482276470755058 | select distinct e.cnpj from document_webhook dw inner join conta c on c.id = dw.conta_id inner join conta_empresa ce on ce.conta_id = c.id inner join empresa e on e.id = ce.empresa_id where c.deleted = false and dw.deleted = false and e.deleted = false and c.status in ('ATIVO', 'TRIAL') | client backend | |||||
| 1665815312 | documents | 24557 | 16402 | postgres | ecac-situacao-fiscal-api | 10.0.24.81 | 42513 | 2025-12-10 22:14:56.519208-03 | 2025-12-10 22:16:10.700064-03 | 2025-12-10 22:16:10.700171-03 | Client | ClientRead | idle | client backend | |||||||
| 16451 | cloudworks | 12889 | 16402 | postgres | 2025-12-10 19:15:00.001944-03 | 2025-12-10 22:16:16.869101-03 | 2025-12-10 19:15:00.003032-03 | 2025-12-10 19:15:00.003032-03 | Timeout | PgSleep | active | 1036070728 | 1036011070 | -4197140451429859788 | CALL af2.manutencaovacuum( 0, -- 'SIMPLE', -- '', -- 99999999999999999, -- 0, -- 99999999999999999, -- 0, -- 99999999999999999, -- 0, -- 99999999999999999, -- 0, -- '', -- 3, -- 500, -- 0, -- 'bloatsizekb DESC' -- ) | pg_cron | |||||
| 5 | postgres | 18395 | 16402 | postgres | pgAdmin 4 - CONN:255024 | 10.0.28.38 | 38852 | 2025-12-10 17:14:49.252683-03 | 2025-12-10 17:18:38.930181-03 | 2025-12-10 17:18:38.930214-03 | Client | ClientRead | idle | -3200963977824915130 | SELECT oid, pg_catalog.format_type(oid, NULL) AS typname FROM pg_catalog.pg_type WHERE oid = ANY($1) ORDER BY oid; | client backend | |||||
| 1338 | 2025-10-09 16:28:03.411906-03 | Activity | BgWriterMain | background writer | |||||||||||||||||
| 1426 | 2025-10-09 16:28:05.073321-03 | Activity | ArchiverMain | archiver | |||||||||||||||||
| 1337 | 2025-10-09 16:28:03.411735-03 | Timeout | CheckpointWriteDelay | checkpointer | |||||||||||||||||
| 1425 | 2025-10-09 16:28:05.073164-03 | Activity | WalWriterMain | walwriter |