explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RIjl

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 16.234 379.789 ↓ 7.6 397 1

Gather (cost=1,000.42..21,086.38 rows=52 width=162) (actual time=364.575..379.789 rows=397 loops=1)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia_2018_11.id, guia_2018_11.pagamento_id, guia_2018_11.beneficiario_id, guia_2018_11.status_analise_glosa, guia_2018_11.numero, guia_2018_11.data_atendimento_inicio, guia_2018_11.data_atendimento_fim, guia_2018_11.senha, guia_2018_11.valor_total_apresentado, guia_2018_11.valor_total_pago, guia_2018_11.diferenca, guia_2018_11.valor_total_glosa_informada, guia_2018_11.quantidade_itens, guia_2018_11.id_tenant, guia_2018_11.id_nucleo, guia_2018_11.guia_associada, guia_2018_11.valor_total_recursado, guia_2018_11.valor_total_aceito, guia_2018_11.data_pagamento
  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=4282 read=5485
2. 0.038 363.555 ↓ 6.0 132 3 / 3

Nested Loop (cost=0.42..20,081.18 rows=22 width=162) (actual time=355.749..363.555 rows=132 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia_2018_11.id, guia_2018_11.pagamento_id, guia_2018_11.beneficiario_id, guia_2018_11.status_analise_glosa, guia_2018_11.numero, guia_2018_11.data_atendimento_inicio, guia_2018_11.data_atendimento_fim, guia_2018_11.senha, guia_2018_11.valor_total_apresentado, guia_2018_11.valor_total_pago, guia_2018_11.diferenca, guia_2018_11.valor_total_glosa_informada, guia_2018_11.quantidade_itens, guia_2018_11.id_tenant, guia_2018_11.id_nucleo, guia_2018_11.guia_associada, guia_2018_11.valor_total_recursado, guia_2018_11.valor_total_aceito, guia_2018_11.data_pagamento
  • Buffers: shared hit=4282 read=5485
  • Worker 0: actual time=350.922..357.828 rows=138 loops=1
  • Buffers: shared hit=1397 read=1712
  • Worker 1: actual time=352.116..358.692 rows=156 loops=1
  • Buffers: shared hit=1341 read=1693
3. 357.805 357.805 ↓ 2.5 159 3 / 3

Parallel Seq Scan on teste_particionado.pagamento (cost=0.00..13,497.22 rows=64 width=51) (actual time=351.924..357.805 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 = 18764))
  • Rows Removed by Filter: 277240
  • Buffers: shared hit=2845 read=5451
  • Worker 0: actual time=346.134..351.280 rows=157 loops=1
  • Buffers: shared hit=926 read=1705
  • Worker 1: actual time=347.246..353.117 rows=134 loops=1
  • Buffers: shared hit=930 read=1674
4. 5.712 5.712 ↑ 13.0 1 476 / 3

Index Scan using guia_2018_11_pagamento_id_idx on teste_particionado.guia_2018_11 (cost=0.42..102.74 rows=13 width=111) (actual time=0.035..0.036 rows=1 loops=476)

  • Output: guia_2018_11.id, guia_2018_11.pagamento_id, guia_2018_11.beneficiario_id, guia_2018_11.status_analise_glosa, guia_2018_11.numero, guia_2018_11.data_atendimento_inicio, guia_2018_11.data_atendimento_fim, guia_2018_11.senha, guia_2018_11.valor_total_apresentado, guia_2018_11.valor_total_pago, guia_2018_11.diferenca, guia_2018_11.valor_total_glosa_informada, guia_2018_11.quantidade_itens, guia_2018_11.id_tenant, guia_2018_11.id_nucleo, guia_2018_11.guia_associada, guia_2018_11.valor_total_recursado, guia_2018_11.valor_total_aceito, guia_2018_11.data_pagamento
  • Index Cond: (guia_2018_11.pagamento_id = pagamento.id)
  • Filter: ((guia_2018_11.data_pagamento >= '2018-11-10'::date) AND (guia_2018_11.data_pagamento <= '2018-11-20'::date))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1437 read=34
  • Worker 0: actual time=0.041..0.041 rows=1 loops=157
  • Buffers: shared hit=471 read=7
  • Worker 1: actual time=0.040..0.041 rows=1 loops=134
  • Buffers: shared hit=411 read=19
Planning time : 0.641 ms
Execution time : 379.853 ms