explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NkX4

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 105.454 4,467.447 ↑ 1.0 600,942 1

Unique (cost=144,585.01..149,157.23 rows=609,629 width=43) (actual time=4,138.256..4,467.447 rows=600,942 loops=1)

2. 3,289.854 4,361.993 ↑ 1.0 602,949 1

Sort (cost=144,585.01..146,109.09 rows=609,629 width=43) (actual time=4,138.255..4,361.993 rows=602,949 loops=1)

  • Sort Key: pc.contr_contrato, ((ac.acordo_numero)::integer) DESC
  • Sort Method: external merge Disk: 32784kB
3. 218.143 1,072.139 ↑ 1.0 602,949 1

Hash Join (cost=22,985.94..67,250.57 rows=609,629 width=43) (actual time=257.356..1,072.139 rows=602,949 loops=1)

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

Hash Join (cost=22,984.85..55,818.93 rows=609,629 width=25) (actual time=257.327..853.980 rows=602,949 loops=1)

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

Seq Scan on tb_acordo ac (cost=0.00..14,847.49 rows=610,749 width=10) (actual time=0.009..172.808 rows=603,994 loops=1)

6. 155.863 256.407 ↑ 1.0 602,991 1

Hash (cost=11,599.82..11,599.82 rows=620,082 width=23) (actual time=256.407..256.407 rows=602,991 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 20600kB
7. 100.544 100.544 ↑ 1.0 602,991 1

Seq Scan on tb_proposta_contrato pc (cost=0.00..11,599.82 rows=620,082 width=23) (actual time=0.016..100.544 rows=602,991 loops=1)

8. 0.005 0.016 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.011 0.011 ↑ 1.0 4 1

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

Planning time : 0.373 ms
Execution time : 4,533.393 ms