explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zg45

Settings
# exclusive inclusive rows x rows loops node
1. 106.104 4,577.752 ↑ 1.0 600,942 1

Unique (cost=142,760.44..147,282.88 rows=602,992 width=43) (actual time=4,251.004..4,577.752 rows=600,942 loops=1)

2. 3,361.332 4,471.648 ↑ 1.0 602,949 1

Sort (cost=142,760.44..144,267.92 rows=602,992 width=43) (actual time=4,251.003..4,471.648 rows=602,949 loops=1)

  • Sort Key: pc.contr_contrato, ((ac.acordo_numero)::integer) DESC
  • Sort Method: external merge Disk: 32,784kB
3. 226.351 1,110.316 ↑ 1.0 602,949 1

Hash Join (cost=22,501.41..66,317.85 rows=602,992 width=43) (actual time=265.602..1,110.316 rows=602,949 loops=1)

  • Hash Cond: (ac.acordo_status_id = sa.status_acordo_id)
4. 451.100 883.957 ↑ 1.0 602,949 1

Hash Join (cost=22,500.32..55,010.66 rows=602,992 width=25) (actual time=265.580..883.957 rows=602,949 loops=1)

  • Hash Cond: (ac.prop_id = pc.prop_id)
5. 168.016 168.016 ↑ 1.0 603,994 1

Seq Scan on tb_acordo ac (cost=0.00..14,781.03 rows=604,103 width=10) (actual time=0.005..168.016 rows=603,994 loops=1)

6. 175.639 264.841 ↑ 1.0 602,991 1

Hash (cost=11,428.92..11,428.92 rows=602,992 width=23) (actual time=264.841..264.841 rows=602,991 loops=1)

  • Buckets: 524,288 Batches: 2 Memory Usage: 20,600kB
7. 89.202 89.202 ↑ 1.0 602,991 1

Seq Scan on tb_proposta_contrato pc (cost=0.00..11,428.92 rows=602,992 width=23) (actual time=0.006..89.202 rows=602,991 loops=1)

8. 0.004 0.008 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=18) (actual time=0.008..0.008 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.004 0.004 ↑ 1.0 4 1

Seq Scan on tb_status_acordo sa (cost=0.00..1.04 rows=4 width=18) (actual time=0.003..0.004 rows=4 loops=1)

Planning time : 0.288 ms
Execution time : 4,646.377 ms