explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ex7y

Settings
# exclusive inclusive rows x rows loops node
1. 0.285 20,091.513 ↓ 18.0 18 1

Nested Loop (cost=47,837.46..47,838.63 rows=1 width=38) (actual time=20,091.020..20,091.513 rows=18 loops=1)

  • Join Filter: (c.max = a.codigo)
  • Rows Removed by Join Filter: 828
2. 0.082 20,091.066 ↓ 18.0 18 1

Merge Join (cost=47,837.46..47,837.61 rows=1 width=18) (actual time=20,090.986..20,091.066 rows=18 loops=1)

  • Merge Cond: (c.bico = bb.bomba)
3. 0.103 20,090.751 ↓ 18.0 18 1

Sort (cost=47,835.59..47,835.60 rows=1 width=15) (actual time=20,090.749..20,090.751 rows=18 loops=1)

  • Sort Key: c.bico
  • Sort Method: quicksort Memory: 25kB
4. 0.004 20,090.648 ↓ 18.0 18 1

Subquery Scan on c (cost=47,835.56..47,835.58 rows=1 width=15) (actual time=20,090.636..20,090.648 rows=18 loops=1)

5. 0.388 20,090.644 ↓ 18.0 18 1

HashAggregate (cost=47,835.56..47,835.57 rows=1 width=7) (actual time=20,090.635..20,090.644 rows=18 loops=1)

  • Group Key: a_1.bico
6. 1.719 20,090.256 ↓ 47.0 47 1

Nested Loop Anti Join (cost=3,307.76..47,835.56 rows=1 width=7) (actual time=501.525..20,090.256 rows=47 loops=1)

  • Join Filter: (op.abastecimento = a_1.codigo)
  • Rows Removed by Join Filter: 2162
7. 0.032 0.032 ↓ 47.0 47 1

Seq Scan on abastecimento a_1 (cost=0.00..1.01 rows=1 width=7) (actual time=0.009..0.032 rows=47 loops=1)

8. 11,048.522 20,088.505 ↑ 118.4 46 47

Hash Join (cost=3,307.76..47,766.45 rows=5,448 width=4) (actual time=427.186..427.415 rows=46 loops=47)

  • Hash Cond: (op.orcamento = o.grid)
9. 8,984.097 8,984.097 ↓ 1.0 1,219,147 47

Seq Scan on orcamento_produto op (cost=0.00..39,832.42 rows=1,219,142 width=12) (actual time=0.005..191.151 rows=1,219,147 loops=47)

10. 0.213 55.886 ↑ 1.1 484 1

Hash (cost=3,300.85..3,300.85 rows=553 width=8) (actual time=55.886..55.886 rows=484 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
11. 55.673 55.673 ↑ 1.1 484 1

Seq Scan on orcamento o (cost=0.00..3,300.85 rows=553 width=8) (actual time=1.282..55.673 rows=484 loops=1)

  • Filter: (status = 'A'::text)
  • Rows Removed by Filter: 123266
12. 0.219 0.233 ↑ 1.0 26 1

Sort (cost=1.87..1.94 rows=26 width=6) (actual time=0.230..0.233 rows=26 loops=1)

  • Sort Key: bb.bomba
  • Sort Method: quicksort Memory: 26kB
13. 0.014 0.014 ↑ 1.0 26 1

Seq Scan on bico_bomba bb (cost=0.00..1.26 rows=26 width=6) (actual time=0.007..0.014 rows=26 loops=1)

14. 0.162 0.162 ↓ 47.0 47 18

Seq Scan on abastecimento a (cost=0.00..1.01 rows=1 width=28) (actual time=0.004..0.009 rows=47 loops=18)

Planning time : 5.755 ms
Execution time : 20,091.933 ms