explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vKT

Settings
# exclusive inclusive rows x rows loops node
1. 71.056 817.858 ↑ 1.3 212,181 1

Group (cost=66,149.32..77,208.52 rows=276,480 width=130) (actual time=718.317..817.858 rows=212,181 loops=1)

  • Group Key: sm.id, stock_picking.name, stock_picking.date_done, stock_picking.date, stock_picking.scheduled_date, stock_picking.partner_id, ((stock_picking.backorder_id IS NOT NULL)), ((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.scheduled_date)))) / '86400'::double precision)), ((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.date)))) / '86400'::double precision)), spt.code, spt.name, p.id, ((((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.scheduled_date)))) / '86400'::double precision)) > '0'::double precision)), cat.id
2. 160.877 746.802 ↑ 1.3 212,181 1

Sort (cost=66,149.32..66,840.52 rows=276,480 width=130) (actual time=718.312..746.802 rows=212,181 loops=1)

  • Sort Key: sm.id, stock_picking.name, stock_picking.date_done, stock_picking.date, stock_picking.scheduled_date, stock_picking.partner_id, ((stock_picking.backorder_id IS NOT NULL)), ((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.scheduled_date)))) / '86400'::double precision)), ((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.date)))) / '86400'::double precision)), spt.code, spt.name, p.id, ((((date_part('epoch'::text, avg((date_trunc('day'::text, stock_picking.date_done) - date_trunc('day'::text, stock_picking.scheduled_date)))) / '86400'::double precision)) > '0'::double precision)), cat.id
  • Sort Method: external merge Disk: 31200kB
3. 49.586 585.925 ↑ 1.3 212,181 1

Hash Join (cost=9,533.28..30,089.93 rows=276,480 width=130) (actual time=60.217..585.925 rows=212,181 loops=1)

  • Hash Cond: (t.categ_id = cat.id)
4. 76.823 536.325 ↑ 1.3 212,181 1

Hash Join (cost=9,531.54..28,578.02 rows=276,480 width=129) (actual time=60.189..536.325 rows=212,181 loops=1)

  • Hash Cond: (p.product_tmpl_id = t.id)
5. 76.329 438.593 ↑ 1.3 212,181 1

Hash Join (cost=6,065.83..24,386.50 rows=276,480 width=129) (actual time=39.242..438.593 rows=212,181 loops=1)

  • Hash Cond: (sm.product_id = p.id)
6. 47.967 347.772 ↑ 1.3 212,181 1

Hash Left Join (cost=3,928.12..21,522.97 rows=276,480 width=125) (actual time=24.714..347.772 rows=212,181 loops=1)

  • Hash Cond: (sm.picking_type_id = spt.id)
7. 80.741 299.762 ↑ 1.3 212,181 1

Merge Right Join (cost=3,923.51..20,770.41 rows=276,480 width=110) (actual time=24.655..299.762 rows=212,181 loops=1)

  • Merge Cond: (stock_picking.id = sm.picking_id)
8. 65.233 95.714 ↑ 1.0 36,330 1

GroupAggregate (cost=3,923.09..5,830.42 rows=36,330 width=63) (actual time=24.633..95.714 rows=36,330 loops=1)

  • Group Key: stock_picking.id, ((stock_picking.backorder_id IS NOT NULL))
9. 23.861 30.481 ↑ 1.0 36,330 1

Sort (cost=3,923.09..4,013.92 rows=36,330 width=47) (actual time=24.615..30.481 rows=36,330 loops=1)

  • Sort Key: stock_picking.id, ((stock_picking.backorder_id IS NOT NULL))
  • Sort Method: external merge Disk: 2200kB
10. 6.620 6.620 ↑ 1.0 36,330 1

Seq Scan on stock_picking (cost=0.00..1,171.30 rows=36,330 width=47) (actual time=0.011..6.620 rows=36,330 loops=1)

11. 44.029 123.307 ↑ 1.0 212,181 1

Materialize (cost=0.42..10,869.12 rows=212,181 width=51) (actual time=0.016..123.307 rows=212,181 loops=1)

12. 79.278 79.278 ↑ 1.0 212,181 1

Index Scan using stock_move_picking_id_index on stock_move sm (cost=0.42..10,338.67 rows=212,181 width=51) (actual time=0.015..79.278 rows=212,181 loops=1)

13. 0.019 0.043 ↑ 1.0 116 1

Hash (cost=3.16..3.16 rows=116 width=23) (actual time=0.043..0.043 rows=116 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
14. 0.024 0.024 ↑ 1.0 116 1

Seq Scan on stock_picking_type spt (cost=0.00..3.16 rows=116 width=23) (actual time=0.010..0.024 rows=116 loops=1)

15. 7.339 14.492 ↑ 1.0 60,787 1

Hash (cost=1,377.87..1,377.87 rows=60,787 width=8) (actual time=14.492..14.492 rows=60,787 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2887kB
16. 7.153 7.153 ↑ 1.0 60,787 1

Seq Scan on product_product p (cost=0.00..1,377.87 rows=60,787 width=8) (actual time=0.022..7.153 rows=60,787 loops=1)

17. 8.856 20.909 ↑ 1.0 60,787 1

Hash (cost=2,705.87..2,705.87 rows=60,787 width=8) (actual time=20.909..20.909 rows=60,787 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2887kB
18. 12.053 12.053 ↑ 1.0 60,787 1

Seq Scan on product_template t (cost=0.00..2,705.87 rows=60,787 width=8) (actual time=0.004..12.053 rows=60,787 loops=1)

19. 0.005 0.014 ↑ 1.0 33 1

Hash (cost=1.33..1.33 rows=33 width=4) (actual time=0.014..0.014 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 0.009 0.009 ↑ 1.0 33 1

Seq Scan on product_category cat (cost=0.00..1.33 rows=33 width=4) (actual time=0.007..0.009 rows=33 loops=1)

Planning time : 1.320 ms
Execution time : 832.176 ms