explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 02uY

Settings
# exclusive inclusive rows x rows loops node
1. 6.119 6,140.005 ↓ 1.6 1,814 1

HashAggregate (cost=1,794,938.25..1,794,949.56 rows=1,131 width=511) (actual time=6,138.932..6,140.005 rows=1,814 loops=1)

  • Group Key: wo.id, so.id, a.id, ap.id, sop.id, wc.id, dp.id, so.name, a.name, a.design_number, ap.name, resource.name, sop.name, ao.id, a.application, (CASE WHEN ((a.application)::text = 'embroidered'::text) THEN concat((((((' x '::
2.          

CTE workorders_backchain

3. 6.282 15.306 ↑ 52.5 8,976 1

Recursive Union (cost=0.00..30,947.58 rows=471,316 width=76) (actual time=0.188..15.306 rows=8,976 loops=1)

4. 1.644 1.644 ↑ 1.0 4,474 1

Seq Scan on mrp_workorder (cost=0.00..206.66 rows=4,666 width=76) (actual time=0.009..1.644 rows=4,474 loops=1)

5. 4.755 7.380 ↑ 51.9 900 5

Hash Join (cost=264.99..2,131.46 rows=46,665 width=76) (actual time=0.427..1.476 rows=900 loops=5)

  • Hash Cond: (p.id = child.prev_work_order_id)
6. 0.520 0.520 ↑ 26.0 1,795 5

WorkTable Scan on workorders_backchain p (cost=0.00..933.20 rows=46,660 width=72) (actual time=0.000..0.104 rows=1,795 loops=5)

7. 0.543 2.105 ↑ 1.7 2,793 1

Hash (cost=206.66..206.66 rows=4,666 width=14) (actual time=2.105..2.105 rows=2,793 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 196kB
8. 1.562 1.562 ↑ 1.0 4,474 1

Seq Scan on mrp_workorder child (cost=0.00..206.66 rows=4,666 width=14) (actual time=0.005..1.562 rows=4,474 loops=1)

9.          

CTE non_sus_squished_mrp_workorders

10. 0.530 18.460 ↑ 1.2 1,804 1

Unique (cost=10,807.23..10,846.12 rows=2,222 width=75) (actual time=17.810..18.460 rows=1,804 loops=1)

11. 1.081 17.930 ↑ 1.2 1,804 1

Sort (cost=10,807.23..10,812.79 rows=2,222 width=75) (actual time=17.809..17.930 rows=1,804 loops=1)

  • Sort Key: wo_2.id, wo_2.sale_order_id, ao_2.artwork_id, ao_2.design_position_id, wo_2.kanban_node_grouping_scrap_id, wo_2.kanban_node_grouping_split_id DESC
  • Sort Method: quicksort Memory: 307kB
12. 0.525 16.849 ↑ 1.2 1,804 1

Hash Left Join (cost=1,233.68..10,683.71 rows=2,222 width=75) (actual time=7.424..16.849 rows=1,804 loops=1)

  • Hash Cond: (wo_2.artwork_order_id = ao_2.id)
13. 0.490 15.731 ↑ 1.2 1,804 1

Hash Join (cost=1,157.67..10,579.66 rows=2,222 width=67) (actual time=6.819..15.731 rows=1,804 loops=1)

  • Hash Cond: (wo_2.sale_order_id = so_2.id)
14. 0.714 10.514 ↑ 1.2 1,806 1

Hash Right Join (cost=247.07..9,638.54 rows=2,242 width=47) (actual time=2.083..10.514 rows=1,806 loops=1)

  • Hash Cond: (mp.id = wo_2.production_id)
  • Filter: ((NOT pp.sus_web) OR (pp.sus_web IS NULL))
  • Rows Removed by Filter: 20
15. 1.618 7.766 ↑ 1.0 1,686 1

Nested Loop Left Join (cost=0.71..9,355.18 rows=1,718 width=9) (actual time=0.033..7.766 rows=1,686 loops=1)

16. 0.867 4.462 ↑ 1.0 1,686 1

Nested Loop Left Join (cost=0.42..8,804.81 rows=1,718 width=9) (actual time=0.026..4.462 rows=1,686 loops=1)

17. 0.223 0.223 ↑ 1.0 1,686 1

Seq Scan on mrp_production mp (cost=0.00..65.18 rows=1,718 width=8) (actual time=0.005..0.223 rows=1,686 loops=1)

18. 3.372 3.372 ↑ 1.0 1 1,686

Index Scan using product_product_pkey on product_product pp (cost=0.42..5.09 rows=1 width=9) (actual time=0.002..0.002 rows=1 loops=1,686)

  • Index Cond: (mp.product_id = id)
19. 1.686 1.686 ↑ 1.0 1 1,686

Index Scan using product_template_pkey on product_template pt (cost=0.29..0.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1,686)

  • Index Cond: (pp.product_tmpl_id = id)
20. 0.438 2.034 ↑ 1.2 1,826 1

Hash (cost=218.32..218.32 rows=2,243 width=42) (actual time=2.034..2.034 rows=1,826 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 167kB
21. 1.596 1.596 ↑ 1.2 1,826 1

Seq Scan on mrp_workorder wo_2 (cost=0.00..218.32 rows=2,243 width=42) (actual time=0.011..1.596 rows=1,826 loops=1)

  • Filter: ((linked_pkg IS NULL) AND (linked_qc IS NULL) AND ((state)::text <> 'cancel'::text))
  • Rows Removed by Filter: 2648
22. 0.092 4.727 ↑ 1.0 545 1

Hash (cost=903.79..903.79 rows=545 width=24) (actual time=4.727..4.727 rows=545 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
23. 0.177 4.635 ↑ 1.0 545 1

Hash Left Join (cost=860.41..903.79 rows=545 width=24) (actual time=4.215..4.635 rows=545 loops=1)

  • Hash Cond: (so_2.partner_id = rp_2.id)
24. 0.308 0.308 ↑ 1.0 545 1

Seq Scan on sale_order so_2 (cost=0.00..36.50 rows=545 width=8) (actual time=0.005..0.308 rows=545 loops=1)

  • Filter: (required_despatch_date IS NOT NULL)
  • Rows Removed by Filter: 5
25. 2.024 4.150 ↑ 1.0 11,334 1

Hash (cost=714.07..714.07 rows=11,707 width=24) (actual time=4.150..4.150 rows=11,334 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 766kB
26. 2.126 2.126 ↑ 1.0 11,334 1

Seq Scan on res_partner rp_2 (cost=0.00..714.07 rows=11,707 width=24) (actual time=0.007..2.126 rows=11,334 loops=1)

27. 0.279 0.593 ↑ 1.1 1,912 1

Hash (cost=50.45..50.45 rows=2,045 width=12) (actual time=0.593..0.593 rows=1,912 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 99kB
28. 0.314 0.314 ↑ 1.1 1,912 1

Seq Scan on kingfisher_artwork_order ao_2 (cost=0.00..50.45 rows=2,045 width=12) (actual time=0.005..0.314 rows=1,912 loops=1)

29.          

CTE sus_squished_mrp_workorders

30. 0.005 23.264 ↑ 2.7 10 1

Unique (cost=5,652.83..5,653.30 rows=27 width=75) (actual time=23.259..23.264 rows=10 loops=1)

31. 0.048 23.259 ↑ 2.7 10 1

Sort (cost=5,652.83..5,652.89 rows=27 width=75) (actual time=23.258..23.259 rows=10 loops=1)

  • Sort Key: wo_3.id, pt_1.school_id, wo_3.received_in_date, wo_3.has_been_started, wo_3.kanban_node_grouping_scrap_id, wo_3.kanban_node_grouping_split_id DESC
  • Sort Method: quicksort Memory: 26kB
32. 6.272 23.211 ↑ 2.7 10 1

Gather (cost=1,088.06..5,652.19 rows=27 width=75) (actual time=22.352..23.211 rows=10 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
33. 0.021 16.939 ↑ 3.2 5 2

Nested Loop Left Join (cost=88.06..4,649.49 rows=16 width=75) (actual time=16.108..16.939 rows=5 loops=2)

34. 0.024 16.915 ↑ 3.2 5 2

Nested Loop Left Join (cost=87.78..4,626.90 rows=16 width=75) (actual time=16.096..16.915 rows=5 loops=2)

35. 0.020 16.886 ↑ 3.2 5 2

Nested Loop Left Join (cost=87.49..4,574.23 rows=16 width=59) (actual time=16.079..16.886 rows=5 loops=2)

36. 0.024 16.862 ↑ 3.2 5 2

Nested Loop Left Join (cost=87.22..4,568.23 rows=16 width=55) (actual time=16.063..16.862 rows=5 loops=2)

37. 0.106 16.833 ↑ 3.2 5 2

Nested Loop (cost=86.94..4,562.07 rows=16 width=47) (actual time=16.044..16.833 rows=5 loops=2)

38. 0.248 16.722 ↓ 1.2 20 2

Hash Join (cost=86.66..4,549.92 rows=16 width=9) (actual time=16.005..16.722 rows=20 loops=2)

  • Hash Cond: (pp_1.id = mp_1.product_id)
39. 15.764 15.764 ↑ 1.2 1,982 2

Parallel Seq Scan on product_product pp_1 (cost=0.00..4,414.63 rows=2,281 width=9) (actual time=13.766..15.764 rows=1,982 loops=2)

  • Filter: sus_web
  • Rows Removed by Filter: 117960
40. 0.234 0.710 ↑ 1.0 1,686 2

Hash (cost=65.18..65.18 rows=1,718 width=8) (actual time=0.710..0.710 rows=1,686 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 82kB
41. 0.476 0.476 ↑ 1.0 1,686 2

Seq Scan on mrp_production mp_1 (cost=0.00..65.18 rows=1,718 width=8) (actual time=0.016..0.476 rows=1,686 loops=2)

42. 0.005 0.005 ↓ 0.0 0 40

Index Scan using mrp_workorder_production_id_index on mrp_workorder wo_3 (cost=0.28..0.75 rows=1 width=42) (actual time=0.005..0.005 rows=0 loops=40)

  • Index Cond: (production_id = mp_1.id)
  • Filter: ((received_in_date IS NOT NULL) AND (linked_pkg IS NULL) AND (linked_qc IS NULL) AND ((state)::text <> 'cancel'::text))
  • Rows Removed by Filter: 3
43. 0.005 0.005 ↑ 1.0 1 10

Index Scan using kingfisher_artwork_order_pkey on kingfisher_artwork_order ao_3 (cost=0.28..0.38 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: (wo_3.artwork_order_id = id)
44. 0.004 0.004 ↑ 1.0 1 10

Index Scan using sale_order_pkey on sale_order so_3 (cost=0.28..0.38 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=10)

  • Index Cond: (wo_3.sale_order_id = id)
45. 0.005 0.005 ↑ 1.0 1 10

Index Scan using res_partner_pkey on res_partner rp_3 (cost=0.29..3.29 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: (so_3.partner_id = id)
46. 0.003 0.003 ↑ 1.0 1 10

Index Scan using product_template_pkey on product_template pt_1 (cost=0.29..1.41 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=10)

  • Index Cond: (pp_1.product_tmpl_id = id)
47.          

CTE sus_associated_workorders

48. 1.587 26.748 ↑ 1.0 4,284 1

Unique (cost=76,805.51..87,144.62 rows=4,476 width=127) (actual time=19.704..26.748 rows=4,284 loops=1)

49. 3.765 25.161 ↑ 52.8 8,562 1

Merge Left Join (cost=76,805.51..86,014.31 rows=452,124 width=127) (actual time=19.703..25.161 rows=8,562 loops=1)

  • Merge Cond: (wo_sus.id = wb.id)
50. 2.238 16.188 ↑ 1.0 4,296 1

Sort (cost=10,075.79..10,086.98 rows=4,476 width=71) (actual time=15.918..16.188 rows=4,296 loops=1)

  • Sort Key: wo_sus.id
  • Sort Method: quicksort Memory: 796kB
51. 0.807 13.950 ↑ 1.0 4,296 1

Hash Left Join (cost=279.10..9,804.37 rows=4,476 width=71) (actual time=3.195..13.950 rows=4,296 loops=1)

  • Hash Cond: ((pt_2.school_id = sus_squish.school_id) AND (wo_sus.has_been_started = sus_squish.has_been_started) AND (wo_sus.received_in_date = sus_squish.received_in_date))
  • Join Filter: ((wo_sus.linked_pkg IS NULL) AND (wo_sus.linked_qc IS NULL) AND ((sus_squish.kanban_node_grouping_scrap_id = wo_sus.kanban_node_grouping_scrap_id) OR ((wo_sus.kanban_node_grouping_scrap_id IS
  • Rows Removed by Join Filter: 44
52. 0.992 13.135 ↑ 1.0 4,284 1

Hash Left Join (cost=278.08..9,752.97 rows=4,476 width=92) (actual time=3.177..13.135 rows=4,284 loops=1)

  • Hash Cond: (wo_sus.workcenter_id = wc_2.id)
53. 1.425 12.107 ↑ 1.0 4,284 1

Hash Right Join (cost=274.98..9,688.32 rows=4,476 width=64) (actual time=3.131..12.107 rows=4,284 loops=1)

  • Hash Cond: (mp_2.id = wo_sus.production_id)
54. 1.658 7.608 ↑ 1.0 1,686 1

Nested Loop Left Join (cost=0.71..9,355.18 rows=1,718 width=13) (actual time=0.022..7.608 rows=1,686 loops=1)

55. 0.676 4.264 ↑ 1.0 1,686 1

Nested Loop Left Join (cost=0.42..8,804.81 rows=1,718 width=13) (actual time=0.014..4.264 rows=1,686 loops=1)

56. 0.216 0.216 ↑ 1.0 1,686 1

Seq Scan on mrp_production mp_2 (cost=0.00..65.18 rows=1,718 width=13) (actual time=0.004..0.216 rows=1,686 loops=1)

57. 3.372 3.372 ↑ 1.0 1 1,686

Index Scan using product_product_pkey on product_product pp_2 (cost=0.42..5.09 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,686)

  • Index Cond: (mp_2.product_id = id)
58. 1.686 1.686 ↑ 1.0 1 1,686

Index Scan using product_template_pkey on product_template pt_2 (cost=0.29..0.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1,686)

  • Index Cond: (pp_2.product_tmpl_id = id)
59. 1.248 3.074 ↑ 1.0 4,284 1

Hash (cost=218.32..218.32 rows=4,476 width=59) (actual time=3.074..3.074 rows=4,284 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 433kB
60. 1.826 1.826 ↑ 1.0 4,284 1

Seq Scan on mrp_workorder wo_sus (cost=0.00..218.32 rows=4,476 width=59) (actual time=0.006..1.826 rows=4,284 loops=1)

  • Filter: ((state)::text <> 'cancel'::text)
  • Rows Removed by Filter: 190
61. 0.005 0.036 ↑ 1.0 16 1

Hash (cost=2.90..2.90 rows=16 width=36) (actual time=0.036..0.036 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
62. 0.017 0.031 ↑ 1.0 16 1

Hash Right Join (cost=1.36..2.90 rows=16 width=36) (actual time=0.023..0.031 rows=16 loops=1)

  • Hash Cond: (rr.id = wc_2.resource_id)
63. 0.004 0.004 ↑ 1.0 28 1

Seq Scan on resource_resource rr (cost=0.00..1.28 rows=28 width=36) (actual time=0.002..0.004 rows=28 loops=1)

64. 0.004 0.010 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=8) (actual time=0.010..0.010 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
65. 0.006 0.006 ↑ 1.0 16 1

Seq Scan on mrp_workcenter wc_2 (cost=0.00..1.16 rows=16 width=8) (actual time=0.004..0.006 rows=16 loops=1)

66. 0.004 0.008 ↑ 2.7 10 1

Hash (cost=0.54..0.54 rows=27 width=21) (actual time=0.008..0.008 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
67. 0.004 0.004 ↑ 2.7 10 1

CTE Scan on sus_squished_mrp_workorders sus_squish (cost=0.00..0.54 rows=27 width=21) (actual time=0.001..0.004 rows=10 loops=1)

68. 0.939 5.208 ↑ 52.4 8,988 1

Materialize (cost=66,729.72..69,086.30 rows=471,316 width=36) (actual time=3.780..5.208 rows=8,988 loops=1)

69. 3.094 4.269 ↑ 52.5 8,976 1

Sort (cost=66,729.72..67,908.01 rows=471,316 width=36) (actual time=3.777..4.269 rows=8,976 loops=1)

  • Sort Key: wb.id
  • Sort Method: quicksort Memory: 1315kB
70. 1.175 1.175 ↑ 52.5 8,976 1

CTE Scan on workorders_backchain wb (cost=0.00..9,426.32 rows=471,316 width=36) (actual time=0.001..1.175 rows=8,976 loops=1)

71.          

CTE non_sus_associated_workorders

72. 2.254 62.691 ↑ 1.0 4,284 1

Unique (cost=68,066.13..78,405.24 rows=4,476 width=127) (actual time=49.550..62.691 rows=4,284 loops=1)

73. 8.060 60.437 ↑ 22.4 20,170 1

Merge Left Join (cost=68,066.13..77,274.93 rows=452,124 width=127) (actual time=49.549..60.437 rows=20,170 loops=1)

  • Merge Cond: (wo_nonsus.id = wb_1.id)
74. 5.615 28.061 ↓ 3.0 13,248 1

Sort (cost=1,336.42..1,347.61 rows=4,476 width=71) (actual time=27.230..28.061 rows=13,248 loops=1)

  • Sort Key: wo_nonsus.id
  • Sort Method: quicksort Memory: 2240kB
75. 2.661 22.446 ↓ 3.0 13,248 1

Hash Left Join (cost=879.97..1,064.99 rows=4,476 width=71) (actual time=8.872..22.446 rows=13,248 loops=1)

  • Hash Cond: (wo_nonsus.production_id = mp_3.id)
76. 2.824 19.270 ↓ 3.0 13,248 1

Hash Left Join (cost=793.32..921.86 rows=4,476 width=70) (actual time=8.347..19.270 rows=13,248 loops=1)

  • Hash Cond: (wo_nonsus.workcenter_id = wc_3.id)
77. 6.650 16.408 ↓ 3.0 13,248 1

Merge Left Join (cost=790.21..857.21 rows=4,476 width=42) (actual time=8.304..16.408 rows=13,248 loops=1)

  • Merge Cond: ((wo_nonsus.sale_order_id = non_sus_squished.sale_order_id) AND (wo_nonsus_artwork_order.artwork_id = non_sus_squished.artwork_id) AND (wo_nonsus_artwork_order.design_position_id =
  • Join Filter: ((wo_nonsus.linked_pkg IS NULL) AND (wo_nonsus.linked_qc IS NULL) AND ((non_sus_squished.kanban_node_grouping_scrap_id = wo_nonsus.kanban_node_grouping_scrap_id) OR ((wo_nonsus.kan
  • Rows Removed by Join Filter: 15746
78. 3.662 6.889 ↑ 1.0 4,284 1

Sort (cost=622.25..633.44 rows=4,476 width=66) (actual time=6.640..6.889 rows=4,284 loops=1)

  • Sort Key: wo_nonsus.sale_order_id, wo_nonsus_artwork_order.artwork_id, wo_nonsus_artwork_order.design_position_id
  • Sort Method: quicksort Memory: 795kB
79. 1.739 3.227 ↑ 1.0 4,284 1

Hash Left Join (cost=76.01..350.83 rows=4,476 width=66) (actual time=0.583..3.227 rows=4,284 loops=1)

  • Hash Cond: (wo_nonsus.artwork_order_id = wo_nonsus_artwork_order.id)
80. 0.922 0.922 ↑ 1.0 4,284 1

Seq Scan on mrp_workorder wo_nonsus (cost=0.00..218.32 rows=4,476 width=62) (actual time=0.006..0.922 rows=4,284 loops=1)

  • Filter: ((state)::text <> 'cancel'::text)
  • Rows Removed by Filter: 190
81. 0.277 0.566 ↑ 1.1 1,912 1

Hash (cost=50.45..50.45 rows=2,045 width=12) (actual time=0.566..0.566 rows=1,912 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 99kB
82. 0.289 0.289 ↑ 1.1 1,912 1

Seq Scan on kingfisher_artwork_order wo_nonsus_artwork_order (cost=0.00..50.45 rows=2,045 width=12) (actual time=0.004..0.289 rows=1,912 loops=1)

83. 1.727 2.869 ↓ 11.9 26,511 1

Sort (cost=167.96..173.51 rows=2,222 width=24) (actual time=1.658..2.869 rows=26,511 loops=1)

  • Sort Key: non_sus_squished.sale_order_id, non_sus_squished.artwork_id, non_sus_squished.design_position_id
  • Sort Method: quicksort Memory: 136kB
84. 1.142 1.142 ↑ 1.2 1,804 1

CTE Scan on non_sus_squished_mrp_workorders non_sus_squished (cost=0.00..44.44 rows=2,222 width=24) (actual time=0.002..1.142 rows=1,804 loops=1)

85. 0.007 0.038 ↑ 1.0 16 1

Hash (cost=2.90..2.90 rows=16 width=36) (actual time=0.038..0.038 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
86. 0.015 0.031 ↑ 1.0 16 1

Hash Right Join (cost=1.36..2.90 rows=16 width=36) (actual time=0.022..0.031 rows=16 loops=1)

  • Hash Cond: (rr_1.id = wc_3.resource_id)
87. 0.004 0.004 ↑ 1.0 28 1

Seq Scan on resource_resource rr_1 (cost=0.00..1.28 rows=28 width=36) (actual time=0.003..0.004 rows=28 loops=1)

88. 0.004 0.012 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=8) (actual time=0.012..0.012 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
89. 0.008 0.008 ↑ 1.0 16 1

Seq Scan on mrp_workcenter wc_3 (cost=0.00..1.16 rows=16 width=8) (actual time=0.005..0.008 rows=16 loops=1)

90. 0.237 0.515 ↑ 1.0 1,686 1

Hash (cost=65.18..65.18 rows=1,718 width=9) (actual time=0.515..0.515 rows=1,686 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 89kB
91. 0.278 0.278 ↑ 1.0 1,686 1

Seq Scan on mrp_production mp_3 (cost=0.00..65.18 rows=1,718 width=9) (actual time=0.007..0.278 rows=1,686 loops=1)

92. 1.440 24.316 ↑ 22.9 20,596 1

Materialize (cost=66,729.72..69,086.30 rows=471,316 width=36) (actual time=22.314..24.316 rows=20,596 loops=1)

93. 3.222 22.876 ↑ 52.5 8,976 1

Sort (cost=66,729.72..67,908.01 rows=471,316 width=36) (actual time=22.311..22.876 rows=8,976 loops=1)

  • Sort Key: wb_1.id
  • Sort Method: quicksort Memory: 1315kB
94. 19.654 19.654 ↑ 52.5 8,976 1

CTE Scan on workorders_backchain wb_1 (cost=0.00..9,426.32 rows=471,316 width=36) (actual time=0.189..19.654 rows=8,976 loops=1)

95. 0.256 6,133.886 ↓ 1.6 1,814 1

Append (cost=1,924.06..1,581,842.43 rows=1,131 width=511) (actual time=94.849..6,133.886 rows=1,814 loops=1)

96. 16.417 6,050.187 ↓ 1.6 1,804 1

Nested Loop Left Join (cost=1,924.06..1,562,010.00 rows=1,117 width=428) (actual time=94.848..6,050.187 rows=1,804 loops=1)

97. 0.872 39.078 ↓ 1.6 1,804 1

Hash Left Join (cost=1,923.77..2,095.48 rows=1,117 width=322) (actual time=28.485..39.078 rows=1,804 loops=1)

  • Hash Cond: (wo.school_id = school.id)
98. 1.068 34.408 ↓ 1.6 1,804 1

Hash Left Join (cost=1,063.36..1,220.97 rows=1,117 width=302) (actual time=24.627..34.408 rows=1,804 loops=1)

  • Hash Cond: (a.design_process_id = dp.id)
99. 1.012 33.331 ↓ 1.6 1,804 1

Hash Left Join (cost=1,062.21..1,207.13 rows=1,117 width=270) (actual time=24.609..33.331 rows=1,804 loops=1)

  • Hash Cond: (wc.resource_id = resource.id)
100. 1.161 32.303 ↓ 1.6 1,804 1

Hash Left Join (cost=1,060.58..1,191.75 rows=1,117 width=242) (actual time=24.586..32.303 rows=1,804 loops=1)

  • Hash Cond: (so.user_id = salesperson.id)
101. 1.063 31.068 ↓ 1.6 1,804 1

Hash Left Join (cost=1,049.23..1,165.04 rows=1,117 width=222) (actual time=24.501..31.068 rows=1,804 loops=1)

  • Hash Cond: (wo.workcenter_id = wc.id)
102. 1.043 29.990 ↓ 1.6 1,804 1

Hash Left Join (cost=1,047.87..1,149.64 rows=1,117 width=218) (actual time=24.478..29.990 rows=1,804 loops=1)

  • Hash Cond: (ao.design_position_id = ap.id)
103. 1.181 28.932 ↓ 1.6 1,804 1

Hash Left Join (cost=1,046.15..1,134.12 rows=1,117 width=186) (actual time=24.456..28.932 rows=1,804 loops=1)

  • Hash Cond: (ao.artwork_id = a.id)
104. 1.220 27.258 ↓ 1.6 1,804 1

Hash Left Join (cost=993.83..1,067.72 rows=1,117 width=113) (actual time=23.954..27.258 rows=1,804 loops=1)

  • Hash Cond: (wo.artwork_order_id = ao.id)
105. 1.300 25.470 ↓ 1.6 1,804 1

Hash Left Join (cost=917.82..977.61 rows=1,117 width=105) (actual time=23.377..25.470 rows=1,804 loops=1)

  • Hash Cond: (wo.sale_order_id = so.id)
106. 18.610 18.610 ↓ 1.6 1,804 1

CTE Scan on non_sus_squished_mrp_workorders wo (cost=0.00..44.44 rows=1,117 width=29) (actual time=17.812..18.610 rows=1,804 loops=1)

  • Filter: ((NOT sus_web) OR (sus_web IS NULL))
107. 0.156 5.560 ↑ 1.0 550 1

Hash (cost=910.94..910.94 rows=550 width=84) (actual time=5.560..5.560 rows=550 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 60kB
108. 0.122 5.404 ↑ 1.0 550 1

Hash Left Join (cost=861.52..910.94 rows=550 width=84) (actual time=4.909..5.404 rows=550 loops=1)

  • Hash Cond: (so.priority = sop.id)
109. 0.366 5.274 ↑ 1.0 550 1

Hash Left Join (cost=860.41..903.85 rows=550 width=52) (actual time=4.892..5.274 rows=550 loops=1)

  • Hash Cond: (so.partner_id = rp.id)
110. 0.081 0.081 ↑ 1.0 550 1

Seq Scan on sale_order so (cost=0.00..36.50 rows=550 width=28) (actual time=0.004..0.081 rows=550 loops=1)

111. 1.982 4.827 ↑ 1.0 11,334 1

Hash (cost=714.07..714.07 rows=11,707 width=28) (actual time=4.827..4.827 rows=11,334 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 778kB
112. 2.845 2.845 ↑ 1.0 11,334 1

Seq Scan on res_partner rp (cost=0.00..714.07 rows=11,707 width=28) (actual time=0.004..2.845 rows=11,334 loops=1)

113. 0.003 0.008 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=36) (actual time=0.008..0.008 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
114. 0.005 0.005 ↑ 1.0 5 1

Seq Scan on sale_order_priority sop (cost=0.00..1.05 rows=5 width=36) (actual time=0.004..0.005 rows=5 loops=1)

115. 0.281 0.568 ↑ 1.1 1,912 1

Hash (cost=50.45..50.45 rows=2,045 width=12) (actual time=0.568..0.568 rows=1,912 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 99kB
116. 0.287 0.287 ↑ 1.1 1,912 1

Seq Scan on kingfisher_artwork_order ao (cost=0.00..50.45 rows=2,045 width=12) (actual time=0.004..0.287 rows=1,912 loops=1)

117. 0.185 0.493 ↑ 1.0 592 1

Hash (cost=44.92..44.92 rows=592 width=77) (actual time=0.493..0.493 rows=592 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 74kB
118. 0.308 0.308 ↑ 1.0 592 1

Seq Scan on kingfisher_artwork_properties a (cost=0.00..44.92 rows=592 width=77) (actual time=0.004..0.308 rows=592 loops=1)

119. 0.008 0.015 ↑ 1.0 32 1

Hash (cost=1.32..1.32 rows=32 width=36) (actual time=0.015..0.015 rows=32 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
120. 0.007 0.007 ↑ 1.0 32 1

Seq Scan on kingfisher_artwork_position ap (cost=0.00..1.32 rows=32 width=36) (actual time=0.003..0.007 rows=32 loops=1)

121. 0.006 0.015 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=8) (actual time=0.015..0.015 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
122. 0.009 0.009 ↑ 1.0 16 1

Seq Scan on mrp_workcenter wc (cost=0.00..1.16 rows=16 width=8) (actual time=0.007..0.009 rows=16 loops=1)

123. 0.011 0.074 ↑ 1.0 62 1

Hash (cost=10.57..10.57 rows=62 width=24) (actual time=0.074..0.074 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
124. 0.012 0.063 ↑ 1.0 62 1

Merge Left Join (cost=0.43..10.57 rows=62 width=24) (actual time=0.043..0.063 rows=62 loops=1)

  • Merge Cond: (salesperson.id = salesperson_partner.id)
125. 0.037 0.037 ↑ 1.0 62 1

Index Only Scan using res_users_pkey on res_users salesperson (cost=0.14..9.07 rows=62 width=4) (actual time=0.031..0.037 rows=62 loops=1)

  • Heap Fetches: 0
126. 0.014 0.014 ↑ 1,300.8 9 1

Index Scan using res_partner_pkey on res_partner salesperson_partner (cost=0.29..2,567.36 rows=11,707 width=24) (actual time=0.010..0.014 rows=9 loops=1)

127. 0.009 0.016 ↑ 1.0 28 1

Hash (cost=1.28..1.28 rows=28 width=36) (actual time=0.016..0.016 rows=28 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
128. 0.007 0.007 ↑ 1.0 28 1

Seq Scan on resource_resource resource (cost=0.00..1.28 rows=28 width=36) (actual time=0.004..0.007 rows=28 loops=1)

129. 0.004 0.009 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=36) (actual time=0.009..0.009 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
130. 0.005 0.005 ↑ 1.0 7 1

Seq Scan on kingfisher_artwork_design_process dp (cost=0.00..1.07 rows=7 width=36) (actual time=0.004..0.005 rows=7 loops=1)

131. 2.024 3.798 ↑ 1.0 11,334 1

Hash (cost=714.07..714.07 rows=11,707 width=24) (actual time=3.798..3.798 rows=11,334 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 766kB
132. 1.774 1.774 ↑ 1.0 11,334 1

Seq Scan on res_partner school (cost=0.00..714.07 rows=11,707 width=24) (actual time=0.003..1.774 rows=11,334 loops=1)

133. 3.608 3.608 ↑ 1.0 1 1,804

Index Scan using res_partner_pkey on res_partner parent (cost=0.29..0.52 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=1,804)

  • Index Cond: (rp.parent_id = id)
134.          

SubPlan (for Nested Loop Left Join)

135. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=100.77..100.78 rows=1 width=32) (never executed)

136. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_8 (cost=0.00..100.71 rows=22 width=4) (never executed)

  • Filter: (root_wo = wo.id)
137. 1.804 645.832 ↑ 1.0 1 1,804

Aggregate (cost=100.77..100.78 rows=1 width=32) (actual time=0.358..0.358 rows=1 loops=1,804)

138. 644.028 644.028 ↑ 22.0 1 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_8 (cost=0.00..100.71 rows=22 width=4) (actual time=0.229..0.357 rows=1 loops=1,804)

  • Filter: (root_wo = wo.id)
  • Rows Removed by Filter: 4283
139. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=100.77..100.78 rows=1 width=4) (never executed)

140. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_9 (cost=0.00..100.71 rows=22 width=4) (never executed)

  • Filter: (root_wo = wo.id)
141. 1.804 582.692 ↑ 1.0 1 1,804

Aggregate (cost=100.77..100.78 rows=1 width=4) (actual time=0.323..0.323 rows=1 loops=1,804)

142. 580.888 580.888 ↑ 22.0 1 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_9 (cost=0.00..100.71 rows=22 width=4) (actual time=0.202..0.322 rows=1 loops=1,804)

  • Filter: (root_wo = wo.id)
  • Rows Removed by Filter: 4283
143. 0.000 0.000 ↓ 0.0 0

Limit (cost=101.09..101.10 rows=1 width=36) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Sort (cost=101.09..101.15 rows=22 width=36) (never executed)

  • Sort Key: (CASE sus_associated_workorders_10.state WHEN 'pending'::text THEN 0 WHEN 'ready'::text THEN 1 WHEN 'progress'::text THEN 2 WHEN 'done'::text THEN 3 WHEN 'cancel'::text THEN 4 ELSE NULL::integer
145. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_10 (cost=0.00..100.98 rows=22 width=36) (never executed)

  • Filter: (root_wo = wo.id)
146. 1.804 586.300 ↑ 1.0 1 1,804

Limit (cost=101.09..101.10 rows=1 width=36) (actual time=0.325..0.325 rows=1 loops=1,804)

147. 3.608 584.496 ↑ 22.0 1 1,804

Sort (cost=101.09..101.15 rows=22 width=36) (actual time=0.324..0.324 rows=1 loops=1,804)

  • Sort Key: (CASE non_sus_associated_workorders_10.state WHEN 'pending'::text THEN 0 WHEN 'ready'::text THEN 1 WHEN 'progress'::text THEN 2 WHEN 'done'::text THEN 3 WHEN 'cancel'::text THEN 4 ELSE NULL::inte
  • Sort Method: quicksort Memory: 25kB
148. 580.888 580.888 ↑ 22.0 1 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_10 (cost=0.00..100.98 rows=22 width=36) (actual time=0.201..0.322 rows=1 loops=1,804)

  • Filter: (root_wo = wo.id)
  • Rows Removed by Filter: 4283
149. 0.000 0.000 ↓ 0.0 0

Result (cost=111.90..111.91 rows=1 width=1) (never executed)

150.          

Initplan (for Result)

151. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_11 (cost=0.00..111.90 rows=1 width=0) (never executed)

  • Filter: ((root_wo = wo.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
152. 1.804 663.872 ↑ 1.0 1 1,804

Result (cost=111.90..111.91 rows=1 width=1) (actual time=0.368..0.368 rows=1 loops=1,804)

153.          

Initplan (for Result)

154. 662.068 662.068 ↓ 0.0 0 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_11 (cost=0.00..111.90 rows=1 width=0) (actual time=0.367..0.367 rows=0 loops=1,804)

  • Filter: ((root_wo = wo.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
  • Rows Removed by Filter: 3792
155. 0.000 0.000 ↓ 0.0 0

Result (cost=9.16..9.17 rows=1 width=1) (never executed)

156.          

Initplan (for Result)

157. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_12 (cost=0.00..100.71 rows=11 width=0) (never executed)

  • Filter: (has_been_assigned AND (root_wo = wo.id))
158. 0.000 589.908 ↑ 1.0 1 1,804

Result (cost=9.16..9.17 rows=1 width=1) (actual time=0.327..0.327 rows=1 loops=1,804)

159.          

Initplan (for Result)

160. 589.908 589.908 ↓ 0.0 0 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_12 (cost=0.00..100.71 rows=11 width=0) (actual time=0.327..0.327 rows=0 loops=1,804)

  • Filter: (has_been_assigned AND (root_wo = wo.id))
  • Rows Removed by Filter: 3308
161. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=111.96..111.97 rows=1 width=32) (never executed)

162. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_13 (cost=0.00..111.90 rows=22 width=32) (never executed)

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo.id))
163. 1.804 779.328 ↑ 1.0 1 1,804

Aggregate (cost=111.96..111.97 rows=1 width=32) (actual time=0.432..0.432 rows=1 loops=1,804)

164. 777.524 777.524 ↑ 22.0 1 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_13 (cost=0.00..111.90 rows=22 width=32) (actual time=0.355..0.431 rows=1 loops=1,804)

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo.id))
  • Rows Removed by Filter: 4283
165. 0.000 0.000 ↓ 0.0 0

Result (cost=5.60..5.61 rows=1 width=1) (never executed)

166.          

Initplan (for Result)

167. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_14 (cost=0.00..123.09 rows=22 width=0) (never executed)

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo.id))
168. 0.000 1,237.544 ↑ 1.0 1 1,804

Result (cost=5.60..5.61 rows=1 width=1) (actual time=0.686..0.686 rows=1 loops=1,804)

169.          

Initplan (for Result)

170. 1,237.544 1,237.544 ↓ 0.0 0 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_14 (cost=0.00..123.09 rows=22 width=0) (actual time=0.686..0.686 rows=0 loops=1,804)

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo.id))
  • Rows Removed by Filter: 4021
171. 0.000 0.000 ↓ 0.0 0

Result (cost=156.66..156.67 rows=1 width=1) (never executed)

172.          

Initplan (for Result)

173. 0.000 0.000 ↓ 0.0 0

CTE Scan on sus_associated_workorders sus_associated_workorders_15 (cost=0.00..156.66 rows=1 width=0) (never executed)

  • Filter: ((root_wo = wo.id) AND ('progress'::text = ANY ((states)::text[])))
174. 1.804 905.608 ↑ 1.0 1 1,804

Result (cost=156.66..156.67 rows=1 width=1) (actual time=0.502..0.502 rows=1 loops=1,804)

175.          

Initplan (for Result)

176. 903.804 903.804 ↓ 0.0 0 1,804

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_15 (cost=0.00..156.66 rows=1 width=0) (actual time=0.501..0.501 rows=0 loops=1,804)

  • Filter: ((root_wo = wo.id) AND ('progress'::text = ANY ((states)::text[])))
  • Rows Removed by Filter: 4269
177. 0.128 83.443 ↑ 1.4 10 1

Nested Loop Left Join (cost=160.47..19,821.12 rows=14 width=428) (actual time=54.408..83.443 rows=10 loops=1)

178. 0.012 24.065 ↑ 1.4 10 1

Nested Loop Left Join (cost=160.18..269.82 rows=14 width=322) (actual time=23.981..24.065 rows=10 loops=1)

179. 0.021 24.003 ↑ 1.4 10 1

Hash Left Join (cost=159.90..161.58 rows=14 width=302) (actual time=23.975..24.003 rows=10 loops=1)

  • Hash Cond: (a_1.design_process_id = dp_1.id)
180. 0.025 23.972 ↑ 1.4 10 1

Hash Right Join (cost=158.74..160.27 rows=14 width=270) (actual time=23.954..23.972 rows=10 loops=1)

  • Hash Cond: (resource_1.id = wc_1.resource_id)
181. 0.008 0.008 ↑ 1.0 28 1

Seq Scan on resource_resource resource_1 (cost=0.00..1.28 rows=28 width=36) (actual time=0.003..0.008 rows=28 loops=1)

182. 0.008 23.939 ↑ 1.4 10 1

Hash (cost=158.57..158.57 rows=14 width=242) (actual time=23.939..23.939 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
183. 0.008 23.931 ↑ 1.4 10 1

Merge Right Join (cost=157.91..158.57 rows=14 width=242) (actual time=23.927..23.931 rows=10 loops=1)

  • Merge Cond: (salesperson_partner_1.id = salesperson_1.id)
184. 0.012 0.012 ↑ 1,300.8 9 1

Index Scan using res_partner_pkey on res_partner salesperson_partner_1 (cost=0.29..2,567.36 rows=11,707 width=24) (actual time=0.006..0.012 rows=9 loops=1)

185. 0.013 23.911 ↑ 1.4 10 1

Sort (cost=157.63..157.66 rows=14 width=222) (actual time=23.910..23.911 rows=10 loops=1)

  • Sort Key: salesperson_1.id
  • Sort Method: quicksort Memory: 27kB
186. 0.010 23.898 ↑ 1.4 10 1

Nested Loop Left Join (cost=41.79..157.36 rows=14 width=222) (actual time=23.814..23.898 rows=10 loops=1)

187. 0.015 23.878 ↑ 1.4 10 1

Hash Left Join (cost=41.65..154.95 rows=14 width=222) (actual time=23.804..23.878 rows=10 loops=1)

  • Hash Cond: (wo_1.workcenter_id = wc_1.id)
188. 0.019 23.851 ↑ 1.4 10 1

Nested Loop Left Join (cost=40.29..153.42 rows=14 width=218) (actual time=23.781..23.851 rows=10 loops=1)

  • -> Index Scan using kingfisher_artwork_position_pkey on kingfisher_artwork_position ap_1 (cost=0.14..0.16 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=1
189. 0.033 23.832 ↑ 1.4 10 1

Nested Loop Left Join (cost=40.15..151.17 rows=14 width=186) (actual time=23.774..23.832 rows=10 loops=1)

  • -> Index Scan using kingfisher_artwork_properties_pkey on kingfisher_artwork_properties a_1 (cost=0.28..0.38 rows=1 width=77) (actual time=0.002..0.002 rows=
  • Index Cond: (ao_1.design_position_id = id)
190. 0.007 23.799 ↑ 1.4 10 1

Nested Loop Left Join (cost=39.88..145.90 rows=14 width=113) (actual time=23.761..23.799 rows=10 loops=1)

  • Join Filter: (so_1.priority = sop_1.id)
  • Rows Removed by Join Filter: 30
  • Index Cond: (ao_1.artwork_id = id)
191. 0.007 23.782 ↑ 1.4 10 1

Nested Loop Left Join (cost=39.88..143.93 rows=14 width=81) (actual time=23.751..23.782 rows=10 loops=1)

192. 0.175 23.755 ↑ 1.4 10 1

Hash Right Join (cost=39.59..97.85 rows=14 width=57) (actual time=23.743..23.755 rows=10 loops=1)

  • Hash Cond: (ao_1.id = wo_1.artwork_order_id)
193. 0.153 0.153 ↑ 1.1 1,912 1

Seq Scan on kingfisher_artwork_order ao_1 (cost=0.00..50.45 rows=2,045 width=12) (actual time=0.004..0.153 rows=1,912 loops=1)

194. 0.012 23.427 ↑ 1.4 10 1

Hash (cost=39.42..39.42 rows=14 width=49) (actual time=23.427..23.427 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
195. 0.065 23.415 ↑ 1.4 10 1

Hash Right Join (cost=0.72..39.42 rows=14 width=49) (actual time=23.404..23.415 rows=10 loops=1)

  • Hash Cond: (so_1.id = wo_1.sale_order_id)
196. 0.075 0.075 ↑ 1.0 550 1

Seq Scan on sale_order so_1 (cost=0.00..36.50 rows=550 width=28) (actual time=0.007..0.075 rows=550 loops=1)

197. 23.275 23.275 ↑ 1.4 10 1

Hash (cost=0.54..0.54 rows=14 width=29) (actual time=23.275..23.275 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • -> CTE Scan on sus_squished_mrp_workorders wo_1 (cost=0.00..0.54 rows=14 width=29) (actual time=23.261..23.270 rows=10 lo
  • Filter: sus_web
198. 0.020 0.020 ↑ 1.0 1 10

Index Scan using res_partner_pkey on res_partner rp_1 (cost=0.29..3.29 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=10)

  • Index Cond: (so_1.partner_id = id)
199. 0.006 0.010 ↑ 1.2 4 10

Materialize (cost=0.00..1.07 rows=5 width=36) (actual time=0.001..0.001 rows=4 loops=10)

200. 0.004 0.004 ↑ 1.2 4 1

Seq Scan on sale_order_priority sop_1 (cost=0.00..1.05 rows=5 width=36) (actual time=0.003..0.004 rows=4 loops=1)

201. 0.006 0.012 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=8) (actual time=0.012..0.012 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
202. 0.006 0.006 ↑ 1.0 16 1

Seq Scan on mrp_workcenter wc_1 (cost=0.00..1.16 rows=16 width=8) (actual time=0.004..0.006 rows=16 loops=1)

203. 0.010 0.010 ↑ 1.0 1 10

Index Only Scan using res_users_pkey on res_users salesperson_1 (cost=0.14..0.17 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=10)

  • Index Cond: (id = so_1.user_id)
  • Heap Fetches: 0
204. 0.005 0.010 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=36) (actual time=0.010..0.010 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
205. 0.005 0.005 ↑ 1.0 7 1

Seq Scan on kingfisher_artwork_design_process dp_1 (cost=0.00..1.07 rows=7 width=36) (actual time=0.004..0.005 rows=7 loops=1)

206. 0.050 0.050 ↑ 1.0 1 10

Index Scan using res_partner_pkey on res_partner school_1 (cost=0.29..7.73 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: (wo_1.school_id = id)
207. 0.010 0.010 ↓ 0.0 0 10

Index Scan using res_partner_pkey on res_partner parent_1 (cost=0.29..0.52 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (rp_1.parent_id = id)
208.          

SubPlan (for Nested Loop Left Join)

209. 0.030 30.090 ↑ 1.0 1 10

Aggregate (cost=100.77..100.78 rows=1 width=32) (actual time=3.009..3.009 rows=1 loops=10)

210. 30.060 30.060 ↑ 22.0 1 10

CTE Scan on sus_associated_workorders (cost=0.00..100.71 rows=22 width=4) (actual time=2.738..3.006 rows=1 loops=10)

  • Filter: (root_wo = wo_1.id)
  • Rows Removed by Filter: 4283
211. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=100.77..100.78 rows=1 width=32) (never executed)

212. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders (cost=0.00..100.71 rows=22 width=4) (never executed)

  • Filter: (root_wo = wo_1.id)
213. 0.010 2.940 ↑ 1.0 1 10

Aggregate (cost=100.77..100.78 rows=1 width=4) (actual time=0.294..0.294 rows=1 loops=10)

214. 2.930 2.930 ↑ 22.0 1 10

CTE Scan on sus_associated_workorders sus_associated_workorders_1 (cost=0.00..100.71 rows=22 width=4) (actual time=0.219..0.293 rows=1 loops=10)

  • Filter: (root_wo = wo_1.id)
  • Rows Removed by Filter: 4283
215. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=100.77..100.78 rows=1 width=4) (never executed)

216. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_1 (cost=0.00..100.71 rows=22 width=4) (never executed)

  • Filter: (root_wo = wo_1.id)
217. 0.010 2.980 ↑ 1.0 1 10

Limit (cost=101.09..101.10 rows=1 width=36) (actual time=0.298..0.298 rows=1 loops=10)

218. 0.040 2.970 ↑ 22.0 1 10

Sort (cost=101.09..101.15 rows=22 width=36) (actual time=0.297..0.297 rows=1 loops=10)

  • Sort Key: (CASE sus_associated_workorders_2.state WHEN 'pending'::text THEN 0 WHEN 'ready'::text THEN 1 WHEN 'progress'::text THEN 2 WHEN 'done'::text THEN 3 WHEN 'cancel'::text THEN 4 ELSE NULL::integer E
  • Sort Method: quicksort Memory: 25kB
219. 2.930 2.930 ↑ 22.0 1 10

CTE Scan on sus_associated_workorders sus_associated_workorders_2 (cost=0.00..100.98 rows=22 width=36) (actual time=0.219..0.293 rows=1 loops=10)

  • Filter: (root_wo = wo_1.id)
  • Rows Removed by Filter: 4283
220. 0.000 0.000 ↓ 0.0 0

Limit (cost=101.09..101.10 rows=1 width=36) (never executed)

221. 0.000 0.000 ↓ 0.0 0

Sort (cost=101.09..101.15 rows=22 width=36) (never executed)

  • Sort Key: (CASE non_sus_associated_workorders_2.state WHEN 'pending'::text THEN 0 WHEN 'ready'::text THEN 1 WHEN 'progress'::text THEN 2 WHEN 'done'::text THEN 3 WHEN 'cancel'::text THEN 4 ELSE NULL::integ
222. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_2 (cost=0.00..100.98 rows=22 width=36) (never executed)

  • Filter: (root_wo = wo_1.id)
223. 0.000 3.600 ↑ 1.0 1 10

Result (cost=111.90..111.91 rows=1 width=1) (actual time=0.360..0.360 rows=1 loops=10)

224.          

Initplan (for Result)

225. 3.600 3.600 ↓ 0.0 0 10

CTE Scan on sus_associated_workorders sus_associated_workorders_3 (cost=0.00..111.90 rows=1 width=0) (actual time=0.360..0.360 rows=0 loops=10)

  • Filter: ((root_wo = wo_1.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
  • Rows Removed by Filter: 3926
226. 0.000 0.000 ↓ 0.0 0

Result (cost=111.90..111.91 rows=1 width=1) (never executed)

227.          

Initplan (for Result)

228. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_3 (cost=0.00..111.90 rows=1 width=0) (never executed)

  • Filter: ((root_wo = wo_1.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
229. 0.010 3.440 ↑ 1.0 1 10

Result (cost=9.16..9.17 rows=1 width=1) (actual time=0.344..0.344 rows=1 loops=10)

230.          

Initplan (for Result)

231. 3.430 3.430 ↓ 0.0 0 10

CTE Scan on sus_associated_workorders sus_associated_workorders_4 (cost=0.00..100.71 rows=11 width=0) (actual time=0.343..0.343 rows=0 loops=10)

  • Filter: (has_been_assigned AND (root_wo = wo_1.id))
  • Rows Removed by Filter: 3540
232. 0.000 0.000 ↓ 0.0 0

Result (cost=9.16..9.17 rows=1 width=1) (never executed)

233.          

Initplan (for Result)

234. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_4 (cost=0.00..100.71 rows=11 width=0) (never executed)

  • Filter: (has_been_assigned AND (root_wo = wo_1.id))
235. 0.010 4.160 ↑ 1.0 1 10

Aggregate (cost=111.96..111.97 rows=1 width=32) (actual time=0.416..0.416 rows=1 loops=10)

236. 4.150 4.150 ↓ 0.0 0 10

CTE Scan on sus_associated_workorders sus_associated_workorders_5 (cost=0.00..111.90 rows=22 width=32) (actual time=0.398..0.415 rows=0 loops=10)

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo_1.id))
  • Rows Removed by Filter: 4284
237. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=111.96..111.97 rows=1 width=32) (never executed)

238. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_5 (cost=0.00..111.90 rows=22 width=32) (never executed)

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo_1.id))
239. 0.000 7.150 ↑ 1.0 1 10

Result (cost=5.60..5.61 rows=1 width=1) (actual time=0.715..0.715 rows=1 loops=10)

240.          

Initplan (for Result)

241. 7.150 7.150 ↓ 0.0 0 10

CTE Scan on sus_associated_workorders sus_associated_workorders_6 (cost=0.00..123.09 rows=22 width=0) (actual time=0.715..0.715 rows=0 loops=10)

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo_1.id))
  • Rows Removed by Filter: 4284
242. 0.000 0.000 ↓ 0.0 0

Result (cost=5.60..5.61 rows=1 width=1) (never executed)

243.          

Initplan (for Result)

244. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_6 (cost=0.00..123.09 rows=22 width=0) (never executed)

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo_1.id))
245. 0.010 4.880 ↑ 1.0 1 10

Result (cost=156.66..156.67 rows=1 width=1) (actual time=0.488..0.488 rows=1 loops=10)

246.          

Initplan (for Result)

247. 4.870 4.870 ↓ 0.0 0 10

CTE Scan on sus_associated_workorders sus_associated_workorders_7 (cost=0.00..156.66 rows=1 width=0) (actual time=0.487..0.487 rows=0 loops=10)

  • Filter: ((root_wo = wo_1.id) AND ('progress'::text = ANY ((states)::text[])))
  • Rows Removed by Filter: 4284
248. 0.000 0.000 ↓ 0.0 0

Result (cost=156.66..156.67 rows=1 width=1) (never executed)

249.          

Initplan (for Result)

250. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_7 (cost=0.00..156.66 rows=1 width=0) (never executed)

  • Filter: ((root_wo = wo_1.id) AND ('progress'::text = ANY ((states)::text[])))
Planning time : 16.836 ms
Execution time : 6,145.179 ms