explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q3Qu

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 0.828 ↓ 11.0 11 1

Group (cost=17.29..17.30 rows=1 width=8) (actual time=0.817..0.828 rows=11 loops=1)

  • Group Key: sml1.id, sml2.id
2. 0.056 0.817 ↓ 11.0 11 1

Sort (cost=17.29..17.30 rows=1 width=8) (actual time=0.815..0.817 rows=11 loops=1)

  • Sort Key: sml1.id, sml2.id
  • Sort Method: quicksort Memory: 25kB
3. 0.018 0.761 ↓ 11.0 11 1

Nested Loop (cost=13.40..17.28 rows=1 width=8) (actual time=0.513..0.761 rows=11 loops=1)

  • Join Filter: ((NOT (sml2.lot_id IS DISTINCT FROM sq2.lot_id)) AND (sqmr2.move_id = sml2.move_id))
4. 0.026 0.699 ↓ 11.0 11 1

Nested Loop (cost=13.26..16.81 rows=1 width=16) (actual time=0.497..0.699 rows=11 loops=1)

  • Join Filter: ((NOT (sml1.lot_id IS DISTINCT FROM sq1.lot_id)) AND (sqmr1.move_id = sml1.move_id))
5. 0.018 0.629 ↓ 5.5 11 1

Nested Loop (cost=13.12..15.85 rows=2 width=24) (actual time=0.475..0.629 rows=11 loops=1)

  • Join Filter: (sm1.raw_material_production_id = mp.id)
6. 0.020 0.556 ↓ 11.0 11 1

Nested Loop (cost=12.99..15.38 rows=1 width=32) (actual time=0.443..0.556 rows=11 loops=1)

7. 0.025 0.503 ↓ 11.0 11 1

Nested Loop (cost=12.86..14.87 rows=1 width=36) (actual time=0.426..0.503 rows=11 loops=1)

8. 0.064 0.423 ↓ 11.0 11 1

Hash Join (cost=12.72..14.36 rows=1 width=40) (actual time=0.392..0.423 rows=11 loops=1)

  • Hash Cond: ((sqmr1.move_id = sm1.id) AND (sqmr1.quant_id = sqcr.consume_quant_id))
9. 0.031 0.031 ↑ 1.0 36 1

Seq Scan on stock_quant_move_rel sqmr1 (cost=0.00..1.36 rows=36 width=8) (actual time=0.022..0.031 rows=36 loops=1)

10. 0.026 0.328 ↓ 4.7 33 1

Hash (cost=12.61..12.61 rows=7 width=32) (actual time=0.328..0.328 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
11. 0.074 0.302 ↓ 4.7 33 1

Hash Join (cost=7.96..12.61 rows=7 width=32) (actual time=0.251..0.302 rows=33 loops=1)

  • Hash Cond: (sm1.raw_material_production_id = sm2.production_id)
12. 0.021 0.021 ↑ 1.0 39 1

Seq Scan on stock_move sm1 (cost=0.00..4.39 rows=39 width=8) (actual time=0.009..0.021 rows=39 loops=1)

13. 0.017 0.207 ↑ 1.0 11 1

Hash (cost=7.82..7.82 rows=11 width=24) (actual time=0.207..0.207 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.058 0.190 ↑ 1.0 11 1

Hash Join (cost=3.12..7.82 rows=11 width=24) (actual time=0.151..0.190 rows=11 loops=1)

  • Hash Cond: (sm2.id = sqmr2.move_id)
15. 0.021 0.021 ↑ 1.0 39 1

Seq Scan on stock_move sm2 (cost=0.00..4.39 rows=39 width=8) (actual time=0.004..0.021 rows=39 loops=1)

16. 0.018 0.111 ↑ 1.0 11 1

Hash (cost=2.99..2.99 rows=11 width=16) (actual time=0.110..0.111 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.046 0.093 ↑ 1.0 11 1

Hash Join (cost=1.25..2.99 rows=11 width=16) (actual time=0.073..0.093 rows=11 loops=1)

  • Hash Cond: (sqmr2.quant_id = sqcr.produce_quant_id)
18. 0.012 0.012 ↑ 1.0 36 1

Seq Scan on stock_quant_move_rel sqmr2 (cost=0.00..1.36 rows=36 width=8) (actual time=0.005..0.012 rows=36 loops=1)

19. 0.024 0.035 ↑ 1.0 11 1

Hash (cost=1.11..1.11 rows=11 width=8) (actual time=0.035..0.035 rows=11 loops=1)

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

Seq Scan on stock_quant_consume_rel sqcr (cost=0.00..1.11 rows=11 width=8) (actual time=0.007..0.011 rows=11 loops=1)

21. 0.055 0.055 ↑ 1.0 1 11

Index Scan using stock_quant_pkey on stock_quant sq1 (cost=0.14..0.49 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=11)

  • Index Cond: (id = sqmr1.quant_id)
22. 0.033 0.033 ↑ 1.0 1 11

Index Scan using stock_quant_pkey on stock_quant sq2 (cost=0.14..0.49 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=11)

  • Index Cond: (id = sqmr2.quant_id)
23. 0.055 0.055 ↑ 1.0 1 11

Index Only Scan using mrp_production_pkey on mrp_production mp (cost=0.13..0.46 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=11)

  • Index Cond: (id = sm2.production_id)
  • Heap Fetches: 11
24. 0.044 0.044 ↑ 1.0 1 11

Index Scan using stock_move_line_move_id_index on stock_move_line sml1 (cost=0.14..0.46 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=11)

  • Index Cond: (move_id = sm1.id)
25. 0.044 0.044 ↑ 1.0 1 11

Index Scan using stock_move_line_move_id_index on stock_move_line sml2 (cost=0.14..0.46 rows=1 width=12) (actual time=0.003..0.004 rows=1 loops=11)

  • Index Cond: (move_id = sm2.id)
Planning time : 19.251 ms
Execution time : 1.298 ms