explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wAgg : Evasão - Percentual Matrícula x Cancelamento

Settings
# exclusive inclusive rows x rows loops node
1. 0.279 1,715.842 ↑ 494.0 108 1

Subquery Scan on p (cost=19,192.17..22,393.41 rows=53,354 width=202) (actual time=1,236.067..1,715.842 rows=108 loops=1)

  • Buffers: shared hit=2073, temp read=676 written=675
2. 423.756 1,715.563 ↑ 494.0 108 1

GroupAggregate (cost=19,192.17..20,926.18 rows=53,354 width=170) (actual time=1,236.054..1,715.563 rows=108 loops=1)

  • Group Key: (to_char(ped.data_pedido, 'YYYY-MM'::text)), inst.nome, curs.duracao_meses_titulo
  • Buffers: shared hit=2073, temp read=676 written=675
3. 439.248 1,291.807 ↓ 1.0 53,790 1

Sort (cost=19,192.17..19,325.56 rows=53,354 width=166) (actual time=1,234.693..1,291.807 rows=53,790 loops=1)

  • Sort Key: (to_char(ped.data_pedido, 'YYYY-MM'::text)), inst.nome, curs.duracao_meses_titulo
  • Sort Method: external merge Disk: 2264kB
  • Buffers: shared hit=2073, temp read=676 written=675
4. 192.200 852.559 ↓ 1.0 53,790 1

Hash Join (cost=4,934.06..10,624.5 rows=53,354 width=166) (actual time=221.876..852.559 rows=53,790 loops=1)

  • Buffers: shared hit=2073, temp read=393 written=391
5. 89.474 659.888 ↓ 1.0 53,790 1

Hash Join (cost=4,897.11..10,174.06 rows=53,354 width=158) (actual time=221.381..659.888 rows=53,790 loops=1)

  • Buffers: shared hit=2050, temp read=393 written=391
6. 118.607 570.050 ↓ 1.0 53,790 1

Hash Join (cost=4,876.07..9,732.85 rows=53,354 width=158) (actual time=221.003..570.05 rows=53,790 loops=1)

  • Buffers: shared hit=2044, temp read=393 written=391
7. 112.434 329.194 ↓ 1.0 53,790 1

Hash Join (cost=2,076.5..4,931.45 rows=53,354 width=162) (actual time=98.687..329.194 rows=53,790 loops=1)

  • Buffers: shared hit=1309, temp read=393 written=391
8. 72.557 118.324 ↑ 1.0 59,420 1

Hash Join (cost=21.93..1,982.67 rows=59,543 width=150) (actual time=0.026..118.324 rows=59,420 loops=1)

  • Buffers: shared hit=891
9. 45.759 45.759 ↑ 1.0 59,420 1

Seq Scan on pedido ped (cost=0..1,803.2 rows=59,543 width=28) (actual time=0.008..45.759 rows=59,420 loops=1)

  • Filter: ((ped.status)::text = ANY ('{wc-cancelled,wc-completed}'::text[]))
  • Buffers: shared hit=890
10. 0.004 0.008 ↑ 265.0 2 1

Hash (cost=15.3..15.3 rows=530 width=122) (actual time=0.007..0.008 rows=2 loops=1)

  • Buffers: shared hit=1
11. 0.004 0.004 ↑ 265.0 2 1

Seq Scan on instituicao inst (cost=0..15.3 rows=530 width=122) (actual time=0.003..0.004 rows=2 loops=1)

  • Buffers: shared hit=1
12. 61.218 98.436 ↓ 1.0 65,542 1

Hash (cost=1,072.63..1,072.63 rows=65,463 width=16) (actual time=98.436..98.436 rows=65,542 loops=1)

  • Buffers: shared hit=418, temp written=143
13. 37.218 37.218 ↓ 1.0 65,542 1

Seq Scan on pedido_oferta pof (cost=0..1,072.63 rows=65,463 width=16) (actual time=0.006..37.218 rows=65,542 loops=1)

  • Buffers: shared hit=418
14. 63.896 122.249 ↑ 1.0 72,836 1

Hash (cost=1,675.15..1,675.15 rows=74,961 width=8) (actual time=122.249..122.249 rows=72,836 loops=1)

  • Buffers: shared hit=735
15. 58.353 58.353 ↑ 1.0 72,836 1

Seq Scan on pagamento pag (cost=0..1,675.15 rows=74,961 width=8) (actual time=0.01..58.353 rows=72,836 loops=1)

  • Filter: (pag.tipo_pagamento = 1)
  • Buffers: shared hit=735
16. 0.195 0.364 ↑ 1.1 507 1

Hash (cost=11.47..11.47 rows=547 width=16) (actual time=0.364..0.364 rows=507 loops=1)

  • Buffers: shared hit=6
17. 0.169 0.169 ↑ 1.1 507 1

Seq Scan on oferta ofe (cost=0..11.47 rows=547 width=16) (actual time=0.004..0.169 rows=507 loops=1)

  • Buffers: shared hit=6
18. 0.223 0.471 ↑ 1.0 558 1

Hash (cost=28.58..28.58 rows=558 width=12) (actual time=0.471..0.471 rows=558 loops=1)

  • Buffers: shared hit=23
19. 0.248 0.248 ↑ 1.0 558 1

Seq Scan on curso curs (cost=0..28.58 rows=558 width=12) (actual time=0.008..0.248 rows=558 loops=1)

  • Buffers: shared hit=23
Planning time : 3.021 ms
Execution time : 1,716.458 ms