explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rLfH

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 71.955 ↓ 0.0 0 1

Insert on stock_move_line_consume_rel (cost=23,856.92..24,190.98 rows=16,703 width=8) (actual time=71.955..71.955 rows=0 loops=1)

2. 0.002 71.954 ↓ 0.0 0 1

Subquery Scan on *SELECT* (cost=23,856.92..24,190.98 rows=16,703 width=8) (actual time=71.954..71.954 rows=0 loops=1)

3. 0.094 71.952 ↓ 0.0 0 1

HashAggregate (cost=23,856.92..24,023.95 rows=16,703 width=8) (actual time=71.952..71.952 rows=0 loops=1)

  • Group Key: sml1.id, sml2.id
4. 41.717 71.858 ↓ 0.0 0 1

Hash Join (cost=11,261.35..23,773.41 rows=16,703 width=8) (actual time=71.858..71.858 rows=0 loops=1)

  • Hash Cond: ((sml2.move_id = sm2.id) AND (sml2.product_id = pp.id))
5. 28.659 28.659 ↑ 1.0 303,990 1

Seq Scan on stock_move_line sml2 (cost=0.00..10,231.90 rows=303,990 width=12) (actual time=0.045..28.659 rows=303,990 loops=1)

6. 0.093 1.482 ↑ 152.2 240 1

Hash (cost=10,713.39..10,713.39 rows=36,531 width=16) (actual time=1.481..1.482 rows=240 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 524kB
7. 0.147 1.389 ↑ 152.2 240 1

Nested Loop (cost=1.85..10,713.39 rows=36,531 width=16) (actual time=0.066..1.389 rows=240 loops=1)

8. 0.094 0.882 ↑ 5.1 90 1

Nested Loop (cost=1.56..10,538.22 rows=456 width=20) (actual time=0.058..0.882 rows=90 loops=1)

9. 0.056 0.518 ↑ 6.1 90 1

Nested Loop (cost=1.27..10,327.05 rows=552 width=24) (actual time=0.048..0.518 rows=90 loops=1)

10. 0.051 0.192 ↑ 6.1 90 1

Nested Loop (cost=0.99..10,162.68 rows=552 width=16) (actual time=0.041..0.192 rows=90 loops=1)

11. 0.014 0.051 ↑ 40.0 6 1

Nested Loop (cost=0.57..11.56 rows=240 width=12) (actual time=0.027..0.051 rows=6 loops=1)

12. 0.016 0.016 ↑ 1.0 3 1

Index Scan using mrp_production_pkey on mrp_production mp (cost=0.28..2.91 rows=3 width=4) (actual time=0.013..0.016 rows=3 loops=1)

  • Index Cond: (id < 5)
  • Filter: ((state)::text = 'done'::text)
  • Rows Removed by Filter: 1
13. 0.021 0.021 ↑ 1.0 2 3

Index Scan using stock_move_raw_material_production_id_fkey_mig_10_0_idx on stock_move sm1 (cost=0.29..2.86 rows=2 width=8) (actual time=0.005..0.007 rows=2 loops=3)

  • Index Cond: (raw_material_production_id = mp.id)
14. 0.090 0.090 ↑ 101.3 15 6

Index Scan using stock_move_line_move_id_index on stock_move_line sml1 (cost=0.42..27.10 rows=1,520 width=12) (actual time=0.008..0.015 rows=15 loops=6)

  • Index Cond: (move_id = sm1.id)
15. 0.270 0.270 ↑ 1.0 1 90

Index Scan using product_product_pkey on product_product pp (cost=0.28..0.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=90)

  • Index Cond: (id = sml1.product_id)
16. 0.270 0.270 ↑ 1.0 1 90

Index Scan using product_template_pkey on product_template pt (cost=0.28..0.38 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=90)

  • Index Cond: (id = pp.product_tmpl_id)
  • Filter: ((tracking)::text <> 'none'::text)
17. 0.360 0.360 ↓ 1.5 3 90

Index Scan using stock_move_production_id_fkey_mig_10_0_idx on stock_move sm2 (cost=0.29..0.36 rows=2 width=8) (actual time=0.003..0.004 rows=3 loops=90)

  • Index Cond: (production_id = sm1.raw_material_production_id)
Planning time : 6.444 ms
Execution time : 72.238 ms