explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2104 : Optimization for: plan #RIjl

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 14.035 44.172 ↓ 7.6 397 1

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

  • 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, pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento
  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=4,412 read=5,355
2. 0.125 30.137 ↓ 6.0 132 3 / 3

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

  • 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, pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento
  • Buffers: shared hit=4,412 read=5,355
  • Worker 0: actual time=24.458..25.263 rows=175 loops=1
  • Buffers: shared hit=1,403 read=1,537
  • Worker 1: actual time=24.630..25.254 rows=158 loops=1
  • Buffers: shared hit=1,034 read=1,467
3. 29.695 29.695 ↓ 2.5 159 3 / 3

Parallel Seq Scan on teste_particionado.pagamento (cost=0.00..13,497.22 rows=64 width=51) (actual time=29.269..29.695 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=2,941 read=5,355
  • Worker 0: actual time=24.388..24.814 rows=175 loops=1
  • Buffers: shared hit=863 read=1,537
  • Worker 1: actual time=24.392..24.776 rows=93 loops=1
  • Buffers: shared hit=747 read=1,467
4. 0.317 0.317 ↑ 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.002..0.002 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=1,471
  • Worker 0: actual time=0.002..0.002 rows=1 loops=175
  • Buffers: shared hit=540
  • Worker 1: actual time=0.003..0.004 rows=2 loops=93
  • Buffers: shared hit=287
Planning time : 0.258 ms
Execution time : 44.224 ms