explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6X36 : Inadimplência Pós - Base - Query

Settings
# exclusive inclusive rows x rows loops node
1. 2,058.950 4,295.889 ↑ 21.9 7,233 1

GroupAggregate (cost=46,511.99..52,049.93 rows=158,227 width=64) (actual time=1,816.036..4,295.889 rows=7,233 loops=1)

  • Group Key: p.instituicao, p.codigo, po.codigo_oferta
  • Filter: (count(p.codigo) > 1)
  • Buffers: shared hit=7143, temp read=327 written=328
2. 609.244 2,236.939 ↑ 2.4 65,906 1

Sort (cost=46,511.99..46,907.55 rows=158,227 width=26) (actual time=1,815.998..2,236.939 rows=65,906 loops=1)

  • Sort Key: p.instituicao, p.codigo, po.codigo_oferta
  • Sort Method: external merge Disk: 2616kB
  • Buffers: shared hit=7143, temp read=327 written=328
3. 273.933 1,627.695 ↑ 2.4 65,906 1

Hash Join (cost=9,832.73..29,060.79 rows=158,227 width=26) (actual time=777.137..1,627.695 rows=65,906 loops=1)

  • Buffers: shared hit=7143
4. 576.696 576.696 ↑ 1.1 201,938 1

Seq Scan on parcela par (cost=0..16,775.05 rows=232,198 width=10) (actual time=0.014..576.696 rows=201,938 loops=1)

  • Filter: ((par.data_pagamento IS NULL) AND (par.data_vencimento < now()) AND ((par.status)::text = ANY ('{pago,atrasado,"não concluído",cancelado,"não confirmado",estornado,registrado,"não registrado"}'::text[])))
  • Buffers: shared hit=4731
5. 42.749 777.066 ↑ 1.3 20,934 1

Hash (cost=9,488.55..9,488.55 rows=27,534 width=24) (actual time=777.066..777.066 rows=20,934 loops=1)

  • Buffers: shared hit=2412
6. 25.144 734.317 ↑ 1.3 20,934 1

Hash Join (cost=7,126.93..9,488.55 rows=27,534 width=24) (actual time=582.811..734.317 rows=20,934 loops=1)

  • Buffers: shared hit=2412
7. 108.986 708.814 ↑ 1.3 20,934 1

Hash Join (cost=7,105.89..9,250.12 rows=27,534 width=36) (actual time=582.443..708.814 rows=20,934 loops=1)

  • Buffers: shared hit=2406
8. 17.506 17.506 ↓ 1.0 65,542 1

Seq Scan on pedido_oferta po (cost=0..1,072.63 rows=65,463 width=16) (actual time=0.005..17.506 rows=65,542 loops=1)

  • Buffers: shared hit=418
9. 42.124 582.322 ↑ 1.4 22,299 1

Hash (cost=6,644.97..6,644.97 rows=30,728 width=28) (actual time=582.322..582.322 rows=22,299 loops=1)

  • Buffers: shared hit=1988
10. 95.334 540.198 ↑ 1.4 22,299 1

Hash Join (cost=3,911.49..6,644.97 rows=30,728 width=28) (actual time=312.626..540.198 rows=22,299 loops=1)

  • Buffers: shared hit=1988
11. 82.118 347.087 ↑ 1.0 55,427 1

Hash Join (cost=2,639.36..4,708.07 rows=57,198 width=28) (actual time=164.925..347.087 rows=55,427 loops=1)

  • Buffers: shared hit=1625
12. 100.294 100.294 ↑ 1.0 72,836 1

Seq Scan on pagamento pag (cost=0..1,675.15 rows=74,961 width=12) (actual time=0.008..100.294 rows=72,836 loops=1)

  • Filter: (pag.tipo_pagamento = 1)
  • Buffers: shared hit=735
13. 88.225 164.675 ↑ 1.0 55,427 1

Hash (cost=1,803.2..1,803.2 rows=55,744 width=16) (actual time=164.675..164.675 rows=55,427 loops=1)

  • Buffers: shared hit=890
14. 76.450 76.450 ↑ 1.0 55,427 1

Seq Scan on pedido p (cost=0..1,803.2 rows=55,744 width=16) (actual time=0.008..76.45 rows=55,427 loops=1)

  • Filter: ((p.status)::text = 'wc-completed'::text)
  • Buffers: shared hit=890
15. 34.256 97.777 ↑ 1.0 40,169 1

Hash (cost=767.06..767.06 rows=40,406 width=8) (actual time=97.776..97.777 rows=40,169 loops=1)

  • Buffers: shared hit=363
16. 63.521 63.521 ↑ 1.0 40,169 1

Seq Scan on forma_pagamento forpag (cost=0..767.06 rows=40,406 width=8) (actual time=0.011..63.521 rows=40,169 loops=1)

  • Buffers: shared hit=363
17. 0.192 0.359 ↑ 1.1 507 1

Hash (cost=11.47..11.47 rows=547 width=12) (actual time=0.359..0.359 rows=507 loops=1)

  • Buffers: shared hit=6
18. 0.167 0.167 ↑ 1.1 507 1

Seq Scan on oferta ofer (cost=0..11.47 rows=547 width=12) (actual time=0.006..0.167 rows=507 loops=1)

  • Buffers: shared hit=6
Planning time : 363.331 ms
Execution time : 4,300.576 ms