explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KnUK : Optimization for: Optimization for: plan #70jY; plan #CkAM

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 95.489 1,659.946 ↑ 1.1 276,770 1

Gather (cost=10,047.73..379,571.15 rows=306,469 width=149) (actual time=48.991..1,659.946 rows=276,770 loops=1)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia.id, guia.pagamento_id, guia.beneficiario_id, guia.status_analise_glosa, guia.numero, guia.data_atendimento_inicio, guia.data_atendimento_fim, guia.senha, guia.valor_total_apresentado, guia.valor_total_pago, guia.diferenca, guia.valor_total_glosa_informada, guia.quantidade_itens, guia.id_tenant, guia.id_nucleo, guia.guia_associada, guia.valor_total_recursado, guia.valor_total_aceito
  • Workers Planned: 2
  • Workers Launched: 2
  • JIT for worker 0:
  • Functions: 12
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 2.803 ms, Inlining 0.000 ms, Optimization 1.087 ms, Emission 20.201 ms, Total 24.091 ms
  • JIT for worker 1:
  • Functions: 12
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 2.359 ms, Inlining 0.000 ms, Optimization 1.173 ms, Emission 18.692 ms, Total 22.224 ms
  • Buffers: shared hit=12961 read=250430
  • Functions: 36
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 7.214 ms, Inlining 0.000 ms, Optimization 3.404 ms, Emission 55.747 ms, Total 66.365 ms
2. 734.248 1,564.457 ↑ 1.4 92,257 3 / 3

Parallel Hash Join (cost=9,047.73..347,924.25 rows=127,695 width=149) (actual time=31.137..1,564.457 rows=92,257 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento, guia.id, guia.pagamento_id, guia.beneficiario_id, guia.status_analise_glosa, guia.numero, guia.data_atendimento_inicio, guia.data_atendimento_fim, guia.senha, guia.valor_total_apresentado, guia.valor_total_pago, guia.diferenca, guia.valor_total_glosa_informada, guia.quantidade_itens, guia.id_tenant, guia.id_nucleo, guia.guia_associada, guia.valor_total_recursado, guia.valor_total_aceito
  • Inner Unique: true
  • Hash Cond: (guia.pagamento_id = pagamento.id)
  • Buffers: shared hit=12961 read=250430
  • Worker 0: actual time=24.631..1555.931 rows=83430 loops=1
  • Buffers: shared hit=4315 read=88564
  • Worker 1: actual time=21.084..1545.218 rows=88534 loops=1
  • Buffers: shared hit=4128 read=83474
3. 799.773 799.773 ↑ 1.2 4,970,420 3 / 3

Parallel Seq Scan on teste_nao_particionando.guia (cost=0.00..322,567.25 rows=6,213,025 width=102) (actual time=0.032..799.773 rows=4,970,420 loops=3)

  • Output: guia.id, guia.pagamento_id, guia.beneficiario_id, guia.status_analise_glosa, guia.numero, guia.data_atendimento_inicio, guia.data_atendimento_fim, guia.senha, guia.valor_total_apresentado, guia.valor_total_pago, guia.diferenca, guia.valor_total_glosa_informada, guia.quantidade_itens, guia.id_tenant, guia.id_nucleo, guia.guia_associada, guia.valor_total_recursado, guia.valor_total_aceito
  • Buffers: shared hit=12907 read=247530
  • Worker 0: actual time=0.041..807.450 rows=5313703 loops=1
  • Buffers: shared hit=4293 read=88498
  • Worker 1: actual time=0.039..796.414 rows=5016553 loops=1
  • Buffers: shared hit=4097 read=83473
4. 23.139 30.436 ↑ 1.4 5,135 3 / 3

Parallel Hash (cost=8,958.64..8,958.64 rows=7,127 width=47) (actual time=30.436..30.436 rows=5,135 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento
  • Buckets: 32768 Batches: 1 Memory Usage: 1632kB
  • Buffers: shared hit=1 read=2891
  • Worker 0: actual time=24.296..24.296 rows=280 loops=1
  • Buffers: shared read=57
  • Worker 1: actual time=20.311..20.312 rows=1 loops=1
  • Buffers: shared read=1
5. 6.721 7.297 ↑ 1.4 5,135 3 / 3

Parallel Bitmap Heap Scan on teste_nao_particionando.pagamento (cost=555.74..8,958.64 rows=7,127 width=47) (actual time=0.760..7.297 rows=5,135 loops=3)

  • Output: pagamento.id, pagamento.operadora_id, pagamento.hospital_id, pagamento.convenio_id, pagamento.protocolo, pagamento.data_pagamento, pagamento.data_recebimento
  • Recheck Cond: ((pagamento.data_pagamento >= '2018-11-10'::date) AND (pagamento.data_pagamento <= '2018-11-20'::date))
  • Heap Blocks: exact=2787
  • Buffers: shared hit=1 read=2891
  • Worker 0: actual time=0.038..0.683 rows=280 loops=1
  • Buffers: shared read=57
  • Worker 1: actual time=0.055..0.058 rows=1 loops=1
  • Buffers: shared read=1
6. 0.576 0.576 ↑ 1.1 15,405 1 / 3

Bitmap Index Scan on pagamento_data_pagamento (cost=0.00..551.46 rows=17,104 width=0) (actual time=1.728..1.728 rows=15,405 loops=1)

  • Index Cond: ((pagamento.data_pagamento >= '2018-11-10'::date) AND (pagamento.data_pagamento <= '2018-11-20'::date))
  • Buffers: shared read=47
Execution time : 1,685.611 ms