explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FB3g : Optimization for: Optimization for: plan #RIjl; plan #2104

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 15.475 52.280 ↓ 5.1 382 1

Gather (cost=1,000.42..22,190.44 rows=75 width=166) (actual time=47.228..52.280 rows=382 loops=1)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia_2018_09.id, guia_2018_09.pagamento_id, guia_2018_09.beneficiario_id, guia_2018_09.status_analise_glosa, guia_2018_09.numero, guia_2018_09.data_atendimento_inicio, guia_2018_09.data_atendimento_fim, guia_2018_09.senha, guia_2018_09.valor_total_apresentado, guia_2018_09.valor_total_pago, guia_2018_09.diferenca, guia_2018_09.valor_total_glosa_informada, guia_2018_09.quantidade_itens, guia_2018_09.id_tenant, guia_2018_09.id_nucleo, guia_2018_09.guia_associada, guia_2018_09.valor_total_recursado, guia_2018_09.valor_total_aceito, guia_2018_09.data_pagamento
  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=6,303 read=3,456
2. 0.019 36.805 ↓ 4.1 127 3 / 3

Nested Loop (cost=0.42..21,182.94 rows=31 width=166) (actual time=35.970..36.805 rows=127 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia_2018_09.id, guia_2018_09.pagamento_id, guia_2018_09.beneficiario_id, guia_2018_09.status_analise_glosa, guia_2018_09.numero, guia_2018_09.data_atendimento_inicio, guia_2018_09.data_atendimento_fim, guia_2018_09.senha, guia_2018_09.valor_total_apresentado, guia_2018_09.valor_total_pago, guia_2018_09.diferenca, guia_2018_09.valor_total_glosa_informada, guia_2018_09.quantidade_itens, guia_2018_09.id_tenant, guia_2018_09.id_nucleo, guia_2018_09.guia_associada, guia_2018_09.valor_total_recursado, guia_2018_09.valor_total_aceito, guia_2018_09.data_pagamento
  • Buffers: shared hit=6,303 read=3,456
  • Worker 0: actual time=28.941..29.651 rows=40 loops=1
  • Buffers: shared hit=1,359 read=754
  • Worker 1: actual time=32.044..32.999 rows=125 loops=1
  • Buffers: shared hit=2,843 read=1,418
3. 36.310 36.310 ↓ 2.5 159 3 / 3

Parallel Seq Scan on teste_particionado.pagamento (cost=0.00..13,497.22 rows=64 width=51) (actual time=35.783..36.310 rows=159 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento
  • Filter: ((pagamento.convenio_id = 65) AND (pagamento.hospital_id = 18,764))
  • Rows Removed by Filter: 277,240
  • Buffers: shared hit=4,840 read=3,456
  • Worker 0: actual time=28.586..29.207 rows=121 loops=1
  • Buffers: shared hit=991 read=754
  • Worker 1: actual time=31.977..32.530 rows=246 loops=1
  • Buffers: shared hit=2,093 read=1,418
4. 0.476 0.476 ↑ 18.0 1 476 / 3

Index Scan using guia_2018_09_pagamento_id_idx on teste_particionado.guia_2018_09 (cost=0.42..119.91 rows=18 width=115) (actual time=0.002..0.003 rows=1 loops=476)

  • Output: guia_2018_09.id, guia_2018_09.pagamento_id, guia_2018_09.beneficiario_id, guia_2018_09.status_analise_glosa, guia_2018_09.numero, guia_2018_09.data_atendimento_inicio, guia_2018_09.data_atendimento_fim, guia_2018_09.senha, guia_2018_09.valor_total_apresentado, guia_2018_09.valor_total_pago, guia_2018_09.diferenca, guia_2018_09.valor_total_glosa_informada, guia_2018_09.quantidade_itens, guia_2018_09.id_tenant, guia_2018_09.id_nucleo, guia_2018_09.guia_associada, guia_2018_09.valor_total_recursado, guia_2018_09.valor_total_aceito, guia_2018_09.data_pagamento
  • Index Cond: (guia_2018_09.pagamento_id = pagamento.id)
  • Filter: ((guia_2018_09.data_pagamento >= '2018-09-10'::date) AND (guia_2018_09.data_pagamento <= '2018-09-20'::date))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1,463
  • Worker 0: actual time=0.003..0.003 rows=0 loops=121
  • Buffers: shared hit=368
  • Worker 1: actual time=0.001..0.002 rows=1 loops=246
  • Buffers: shared hit=750
Planning time : 0.336 ms
Execution time : 52.342 ms