explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kH3o

Settings
# exclusive inclusive rows x rows loops node
1. 1.142 305.708 ↓ 2.2 406 1

HashAggregate (cost=108,929.48..108,931.33 rows=185 width=511) (actual time=305.472..305.708 rows=406 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. 1.346 3.493 ↑ 45.5 2,241 1

Recursive Union (cost=0.00..6,683.55 rows=101,859 width=76) (actual time=0.008..3.493 rows=2,241 loops=1)

4. 0.327 0.327 ↑ 1.0 979 1

Seq Scan on mrp_workorder (cost=0.00..44.09 rows=1,009 width=76) (actual time=0.005..0.327 rows=979 loops=1)

5. 1.272 1.820 ↑ 40.0 252 5

Hash Join (cost=56.70..460.23 rows=10,085 width=76) (actual time=0.091..0.364 rows=252 loops=5)

  • Hash Cond: (p.id = child.prev_work_order_id)
6. 0.120 0.120 ↑ 22.5 448 5

WorkTable Scan on workorders_backchain p (cost=0.00..201.80 rows=10,090 width=72) (actual time=0.000..0.024 rows=448 loops=5)

7. 0.113 0.428 ↑ 1.6 642 1

Hash (cost=44.09..44.09 rows=1,009 width=14) (actual time=0.428..0.428 rows=642 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 39kB
8. 0.315 0.315 ↑ 1.0 979 1

Seq Scan on mrp_workorder child (cost=0.00..44.09 rows=1,009 width=14) (actual time=0.003..0.315 rows=979 loops=1)

9.          

CTE non_sus_squished_mrp_workorders

10. 0.113 2.887 ↓ 1.0 371 1

Unique (cost=3,661.35..3,667.77 rows=367 width=76) (actual time=2.755..2.887 rows=371 loops=1)

11. 0.167 2.774 ↓ 1.0 371 1

Sort (cost=3,661.35..3,662.27 rows=367 width=76) (actual time=2.755..2.774 rows=371 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: 77kB
12. 0.095 2.607 ↓ 1.0 371 1

Hash Left Join (cost=1,003.85..3,645.71 rows=367 width=76) (actual time=1.073..2.607 rows=371 loops=1)

  • Hash Cond: (wo_2.artwork_order_id = ao_2.id)
13. 0.091 2.298 ↓ 1.0 371 1

Hash Join (cost=971.93..3,609.16 rows=367 width=68) (actual time=0.857..2.298 rows=371 loops=1)

  • Hash Cond: (wo_2.sale_order_id = so_2.id)
14. 0.139 1.830 ↑ 1.3 375 1

Hash Right Join (cost=53.50..2,685.30 rows=495 width=48) (actual time=0.477..1.830 rows=375 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: 42
15. 0.207 1.246 ↑ 1.0 337 1

Nested Loop Left Join (cost=0.71..2,624.74 rows=337 width=9) (actual time=0.018..1.246 rows=337 loops=1)

16. 0.323 0.702 ↑ 1.0 337 1

Nested Loop Left Join (cost=0.42..2,516.81 rows=337 width=9) (actual time=0.012..0.702 rows=337 loops=1)

17. 0.042 0.042 ↑ 1.0 337 1

Seq Scan on mrp_production mp (cost=0.00..13.37 rows=337 width=8) (actual time=0.004..0.042 rows=337 loops=1)

18. 0.337 0.337 ↑ 1.0 1 337

Index Scan using product_product_pkey on product_product pp (cost=0.42..7.43 rows=1 width=9) (actual time=0.001..0.001 rows=1 loops=337)

  • Index Cond: (mp.product_id = id)
19. 0.337 0.337 ↑ 1.0 1 337

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=337)

  • Index Cond: (pp.product_tmpl_id = id)
20. 0.090 0.445 ↑ 1.2 417 1

Hash (cost=46.61..46.61 rows=495 width=43) (actual time=0.445..0.445 rows=417 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 40kB
21. 0.355 0.355 ↑ 1.2 417 1

Seq Scan on mrp_workorder wo_2 (cost=0.00..46.61 rows=495 width=43) (actual time=0.009..0.355 rows=417 loops=1)

  • Filter: ((linked_pkg IS NULL) AND (linked_qc IS NULL) AND ((state)::text <> 'cancel'::text))
  • Rows Removed by Filter: 562
22. 0.032 0.377 ↑ 1.0 187 1

Hash (cost=916.09..916.09 rows=187 width=24) (actual time=0.377..0.377 rows=187 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
23. 0.058 0.345 ↑ 1.0 187 1

Nested Loop Left Join (cost=0.29..916.09 rows=187 width=24) (actual time=0.008..0.345 rows=187 loops=1)

24. 0.100 0.100 ↑ 1.0 187 1

Seq Scan on sale_order so_2 (cost=0.00..15.52 rows=187 width=8) (actual time=0.004..0.100 rows=187 loops=1)

  • Filter: (required_despatch_date IS NOT NULL)
  • Rows Removed by Filter: 65
25. 0.187 0.187 ↑ 1.0 1 187

Index Scan using res_partner_pkey on res_partner rp_2 (cost=0.29..4.82 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=187)

  • Index Cond: (so_2.partner_id = id)
26. 0.095 0.214 ↑ 1.0 752 1

Hash (cost=22.52..22.52 rows=752 width=12) (actual time=0.214..0.214 rows=752 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
27. 0.119 0.119 ↑ 1.0 752 1

Seq Scan on kingfisher_artwork_order ao_2 (cost=0.00..22.52 rows=752 width=12) (actual time=0.005..0.119 rows=752 loops=1)

28.          

CTE sus_squished_mrp_workorders

29. 0.013 2.195 ↓ 35.0 35 1

Unique (cost=2,549.91..2,549.93 rows=1 width=76) (actual time=2.181..2.195 rows=35 loops=1)

30. 0.026 2.182 ↓ 35.0 35 1

Sort (cost=2,549.91..2,549.92 rows=1 width=76) (actual time=2.180..2.182 rows=35 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: 29kB
31. 0.047 2.156 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.54..2,549.90 rows=1 width=76) (actual time=0.110..2.156 rows=35 loops=1)

32. 0.027 2.074 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.26..2,542.10 rows=1 width=76) (actual time=0.104..2.074 rows=35 loops=1)

33. 0.527 2.012 ↓ 35.0 35 1

Nested Loop Left Join (cost=0.97..2,537.65 rows=1 width=60) (actual time=0.100..2.012 rows=35 loops=1)

  • Join Filter: (wo_3.sale_order_id = so_3.id)
  • Rows Removed by Join Filter: 7005
34. 0.009 0.960 ↓ 35.0 35 1

Nested Loop Left Join (cost=0.97..2,518.98 rows=1 width=56) (actual time=0.059..0.960 rows=35 loops=1)

35. 0.027 0.881 ↓ 35.0 35 1

Nested Loop (cost=0.70..2,518.44 rows=1 width=48) (actual time=0.054..0.881 rows=35 loops=1)

36. 0.000 0.716 ↓ 46.0 46 1

Nested Loop (cost=0.42..2,517.63 rows=1 width=9) (actual time=0.047..0.716 rows=46 loops=1)

37. 0.043 0.043 ↑ 1.0 337 1

Seq Scan on mrp_production mp_1 (cost=0.00..13.37 rows=337 width=8) (actual time=0.008..0.043 rows=337 loops=1)

38. 0.674 0.674 ↓ 0.0 0 337

Index Scan using product_product_pkey on product_product pp_1 (cost=0.42..7.43 rows=1 width=9) (actual time=0.002..0.002 rows=0 loops=337)

  • Index Cond: (id = mp_1.product_id)
  • Filter: sus_web
  • Rows Removed by Filter: 1
39. 0.138 0.138 ↑ 1.0 1 46

Index Scan using mrp_workorder_production_id_index on mrp_workorder wo_3 (cost=0.28..0.80 rows=1 width=43) (actual time=0.002..0.003 rows=1 loops=46)

  • 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: 2
40. 0.070 0.070 ↑ 1.0 1 35

Index Scan using kingfisher_artwork_order_pkey on kingfisher_artwork_order ao_3 (cost=0.28..0.54 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (wo_3.artwork_order_id = id)
41. 0.525 0.525 ↑ 1.3 201 35

Seq Scan on sale_order so_3 (cost=0.00..15.52 rows=252 width=8) (actual time=0.001..0.015 rows=201 loops=35)

42. 0.035 0.035 ↑ 1.0 1 35

Index Scan using res_partner_pkey on res_partner rp_3 (cost=0.29..4.45 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (so_3.partner_id = id)
43. 0.035 0.035 ↑ 1.0 1 35

Index Scan using product_template_pkey on product_template pt_1 (cost=0.29..7.80 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=35)

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

CTE sus_associated_workorders

45. 0.373 5.807 ↑ 1.0 929 1

Unique (cost=16,065.94..18,283.82 rows=957 width=127) (actual time=4.054..5.807 rows=929 loops=1)

46. 0.982 5.434 ↑ 41.7 2,315 1

Merge Left Join (cost=16,065.94..18,042.29 rows=96,610 width=127) (actual time=4.053..5.434 rows=2,315 loops=1)

  • Merge Cond: (wo_sus.id = wb.id)
47. 0.469 3.230 ↓ 1.1 1,097 1

Sort (cost=2,770.02..2,772.41 rows=957 width=71) (actual time=3.169..3.230 rows=1,097 loops=1)

  • Sort Key: wo_sus.id
  • Sort Method: quicksort Memory: 203kB
48. 0.267 2.761 ↓ 1.1 1,097 1

Hash Left Join (cost=62.42..2,722.64 rows=957 width=71) (actual time=0.716..2.761 rows=1,097 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: 342
49. 0.216 2.462 ↑ 1.0 929 1

Hash Left Join (cost=62.38..2,711.82 rows=957 width=92) (actual time=0.679..2.462 rows=929 loops=1)

  • Hash Cond: (wo_sus.workcenter_id = wc_2.id)
50. 0.298 2.220 ↑ 1.0 929 1

Hash Right Join (cost=59.28..2,695.55 rows=957 width=64) (actual time=0.649..2.220 rows=929 loops=1)

  • Hash Cond: (mp_2.id = wo_sus.production_id)
51. 0.240 1.290 ↑ 1.0 337 1

Nested Loop Left Join (cost=0.71..2,624.74 rows=337 width=13) (actual time=0.012..1.290 rows=337 loops=1)

52. 0.337 0.713 ↑ 1.0 337 1

Nested Loop Left Join (cost=0.42..2,516.81 rows=337 width=13) (actual time=0.007..0.713 rows=337 loops=1)

53. 0.039 0.039 ↑ 1.0 337 1

Seq Scan on mrp_production mp_2 (cost=0.00..13.37 rows=337 width=13) (actual time=0.003..0.039 rows=337 loops=1)

54. 0.337 0.337 ↑ 1.0 1 337

Index Scan using product_product_pkey on product_product pp_2 (cost=0.42..7.43 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=337)

  • Index Cond: (mp_2.product_id = id)
55. 0.337 0.337 ↑ 1.0 1 337

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=337)

  • Index Cond: (pp_2.product_tmpl_id = id)
56. 0.241 0.632 ↑ 1.0 929 1

Hash (cost=46.61..46.61 rows=957 width=59) (actual time=0.632..0.632 rows=929 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 88kB
57. 0.391 0.391 ↑ 1.0 929 1

Seq Scan on mrp_workorder wo_sus (cost=0.00..46.61 rows=957 width=59) (actual time=0.004..0.391 rows=929 loops=1)

  • Filter: ((state)::text <> 'cancel'::text)
  • Rows Removed by Filter: 50
58. 0.003 0.026 ↑ 1.0 16 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
59. 0.011 0.023 ↑ 1.0 16 1

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

  • Hash Cond: (rr.id = wc_2.resource_id)
60. 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)

61. 0.002 0.008 ↑ 1.0 16 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
62. 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.003..0.006 rows=16 loops=1)

63. 0.007 0.032 ↓ 35.0 35 1

Hash (cost=0.02..0.02 rows=1 width=21) (actual time=0.032..0.032 rows=35 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
64. 0.025 0.025 ↓ 35.0 35 1

CTE Scan on sus_squished_mrp_workorders sus_squish (cost=0.00..0.02 rows=1 width=21) (actual time=0.001..0.025 rows=35 loops=1)

65. 0.227 1.222 ↑ 42.3 2,409 1

Materialize (cost=13,295.92..13,805.22 rows=101,859 width=36) (actual time=0.881..1.222 rows=2,409 loops=1)

66. 0.728 0.995 ↑ 45.5 2,241 1

Sort (cost=13,295.92..13,550.57 rows=101,859 width=36) (actual time=0.880..0.995 rows=2,241 loops=1)

  • Sort Key: wb.id
  • Sort Method: quicksort Memory: 342kB
67. 0.267 0.267 ↑ 45.5 2,241 1

CTE Scan on workorders_backchain wb (cost=0.00..2,037.18 rows=101,859 width=36) (actual time=0.001..0.267 rows=2,241 loops=1)

68.          

CTE non_sus_associated_workorders

69. 0.394 9.454 ↑ 1.0 929 1

Unique (cost=13,535.57..15,753.44 rows=957 width=127) (actual time=7.614..9.454 rows=929 loops=1)

70. 1.030 9.060 ↑ 37.9 2,549 1

Merge Left Join (cost=13,535.57..15,511.92 rows=96,610 width=127) (actual time=7.613..9.060 rows=2,549 loops=1)

  • Merge Cond: (wo_nonsus.id = wb_1.id)
71. 0.425 2.736 ↓ 1.2 1,145 1

Sort (cost=239.65..242.04 rows=957 width=71) (actual time=2.671..2.736 rows=1,145 loops=1)

  • Sort Key: wo_nonsus.id
  • Sort Method: quicksort Memory: 210kB
72. 0.227 2.311 ↓ 1.2 1,145 1

Hash Left Join (cost=128.04..192.26 rows=957 width=71) (actual time=1.185..2.311 rows=1,145 loops=1)

  • Hash Cond: (wo_nonsus.production_id = mp_3.id)
73. 0.242 1.995 ↓ 1.2 1,145 1

Hash Left Join (cost=110.46..162.63 rows=957 width=70) (actual time=1.093..1.995 rows=1,145 loops=1)

  • Hash Cond: (wo_nonsus.workcenter_id = wc_3.id)
74. 0.485 1.729 ↓ 1.2 1,145 1

Hash Right Join (cost=107.35..146.36 rows=957 width=42) (actual time=1.067..1.729 rows=1,145 loops=1)

  • Hash Cond: ((non_sus_squished.sale_order_id = wo_nonsus.sale_order_id) AND (non_sus_squished.artwork_id = wo_nonsus_artwork_order.artwork_id) AND (non_sus_squished.design_position_id = wo_nonsu
  • 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: 772
75. 0.183 0.183 ↓ 1.0 371 1

CTE Scan on non_sus_squished_mrp_workorders non_sus_squished (cost=0.00..7.34 rows=367 width=24) (actual time=0.000..0.183 rows=371 loops=1)

76. 0.280 1.061 ↑ 1.0 929 1

Hash (cost=90.61..90.61 rows=957 width=66) (actual time=1.061..1.061 rows=929 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 95kB
77. 0.379 0.781 ↑ 1.0 929 1

Hash Left Join (cost=31.92..90.61 rows=957 width=66) (actual time=0.210..0.781 rows=929 loops=1)

  • Hash Cond: (wo_nonsus.artwork_order_id = wo_nonsus_artwork_order.id)
78. 0.199 0.199 ↑ 1.0 929 1

Seq Scan on mrp_workorder wo_nonsus (cost=0.00..46.61 rows=957 width=62) (actual time=0.004..0.199 rows=929 loops=1)

  • Filter: ((state)::text <> 'cancel'::text)
  • Rows Removed by Filter: 50
79. 0.094 0.203 ↑ 1.0 752 1

Hash (cost=22.52..22.52 rows=752 width=12) (actual time=0.203..0.203 rows=752 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
80. 0.109 0.109 ↑ 1.0 752 1

Seq Scan on kingfisher_artwork_order wo_nonsus_artwork_order (cost=0.00..22.52 rows=752 width=12) (actual time=0.003..0.109 rows=752 loops=1)

81. 0.003 0.024 ↑ 1.0 16 1

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

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

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

  • Hash Cond: (rr_1.id = wc_3.resource_id)
83. 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.002..0.004 rows=28 loops=1)

84. 0.003 0.008 ↑ 1.0 16 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
85. 0.005 0.005 ↑ 1.0 16 1

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

86. 0.041 0.089 ↑ 1.0 337 1

Hash (cost=13.37..13.37 rows=337 width=9) (actual time=0.089..0.089 rows=337 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
87. 0.048 0.048 ↑ 1.0 337 1

Seq Scan on mrp_production mp_3 (cost=0.00..13.37 rows=337 width=9) (actual time=0.003..0.048 rows=337 loops=1)

88. 0.240 5.294 ↑ 38.5 2,643 1

Materialize (cost=13,295.92..13,805.22 rows=101,859 width=36) (actual time=4.938..5.294 rows=2,643 loops=1)

89. 0.617 5.054 ↑ 45.5 2,241 1

Sort (cost=13,295.92..13,550.57 rows=101,859 width=36) (actual time=4.938..5.054 rows=2,241 loops=1)

  • Sort Key: wb_1.id
  • Sort Method: quicksort Memory: 342kB
90. 4.437 4.437 ↑ 45.5 2,241 1

CTE Scan on workorders_backchain wb_1 (cost=0.00..2,037.18 rows=101,859 width=36) (actual time=0.009..4.437 rows=2,241 loops=1)

91. 0.054 304.566 ↓ 2.2 406 1

Append (cost=70.02..61,974.78 rows=185 width=511) (actual time=13.482..304.566 rows=406 loops=1)

92. 1.973 270.850 ↓ 2.0 371 1

Nested Loop Left Join (cost=70.02..61,613.73 rows=184 width=419) (actual time=13.482..270.850 rows=371 loops=1)

93. 0.319 6.209 ↓ 2.0 371 1

Nested Loop Left Join (cost=69.73..1,822.79 rows=184 width=326) (actual time=3.245..6.209 rows=371 loops=1)

  • Join Filter: (a.design_process_id = dp.id)
  • Rows Removed by Join Filter: 869
94. 0.239 5.890 ↓ 2.0 371 1

Nested Loop Left Join (cost=69.73..1,804.43 rows=184 width=314) (actual time=3.239..5.890 rows=371 loops=1)

95. 0.172 5.651 ↓ 2.0 371 1

Hash Left Join (cost=69.45..912.77 rows=184 width=294) (actual time=3.235..5.651 rows=371 loops=1)

  • Hash Cond: (wc.resource_id = resource.id)
96. 0.177 5.468 ↓ 2.0 371 1

Hash Left Join (cost=67.82..908.88 rows=184 width=266) (actual time=3.221..5.468 rows=371 loops=1)

  • Hash Cond: (so.user_id = salesperson.id)
97. 0.178 5.244 ↓ 2.0 371 1

Hash Left Join (cost=56.41..894.94 rows=184 width=246) (actual time=3.171..5.244 rows=371 loops=1)

  • Hash Cond: (wo.workcenter_id = wc.id)
98. 0.170 5.058 ↓ 2.0 371 1

Hash Left Join (cost=55.05..891.26 rows=184 width=242) (actual time=3.161..5.058 rows=371 loops=1)

  • Hash Cond: (ao.design_position_id = ap.id)
99. 0.180 4.877 ↓ 2.0 371 1

Hash Left Join (cost=53.33..887.27 rows=184 width=210) (actual time=3.147..4.877 rows=371 loops=1)

  • Hash Cond: (ao.artwork_id = a.id)
100. 0.182 4.681 ↓ 2.0 371 1

Hash Left Join (cost=51.99..883.72 rows=184 width=113) (actual time=3.129..4.681 rows=371 loops=1)

  • Hash Cond: (wo.artwork_order_id = ao.id)
101. 0.154 4.291 ↓ 2.0 371 1

Hash Left Join (cost=20.07..849.48 rows=184 width=105) (actual time=2.918..4.291 rows=371 loops=1)

  • Hash Cond: (so.priority = sop.id)
102. 0.165 4.132 ↓ 2.0 371 1

Nested Loop Left Join (cost=18.96..846.27 rows=184 width=73) (actual time=2.911..4.132 rows=371 loops=1)

103. 0.182 3.225 ↓ 2.0 371 1

Hash Left Join (cost=18.67..28.32 rows=184 width=49) (actual time=2.907..3.225 rows=371 loops=1)

  • Hash Cond: (wo.sale_order_id = so.id)
104. 2.897 2.897 ↓ 2.0 371 1

CTE Scan on non_sus_squished_mrp_workorders wo (cost=0.00..7.34 rows=184 width=29) (actual time=2.757..2.897 rows=371 loops=1)

  • Filter: ((NOT sus_web) OR (sus_web IS NULL))
105. 0.043 0.146 ↑ 1.0 252 1

Hash (cost=15.52..15.52 rows=252 width=28) (actual time=0.146..0.146 rows=252 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
106. 0.103 0.103 ↑ 1.0 252 1

Seq Scan on sale_order so (cost=0.00..15.52 rows=252 width=28) (actual time=0.003..0.103 rows=252 loops=1)

107. 0.742 0.742 ↑ 1.0 1 371

Index Scan using res_partner_pkey on res_partner rp (cost=0.29..4.45 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=371)

  • Index Cond: (so.partner_id = id)
108. 0.002 0.005 ↑ 1.0 5 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
109. 0.003 0.003 ↑ 1.0 5 1

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

110. 0.095 0.208 ↑ 1.0 752 1

Hash (cost=22.52..22.52 rows=752 width=12) (actual time=0.208..0.208 rows=752 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
111. 0.113 0.113 ↑ 1.0 752 1

Seq Scan on kingfisher_artwork_order ao (cost=0.00..22.52 rows=752 width=12) (actual time=0.003..0.113 rows=752 loops=1)

112. 0.005 0.016 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=101) (actual time=0.016..0.016 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
113. 0.011 0.011 ↑ 1.0 15 1

Seq Scan on kingfisher_artwork_properties a (cost=0.00..1.15 rows=15 width=101) (actual time=0.004..0.011 rows=15 loops=1)

114. 0.005 0.011 ↑ 1.0 32 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
115. 0.006 0.006 ↑ 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.006 rows=32 loops=1)

116. 0.003 0.008 ↑ 1.0 16 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
117. 0.005 0.005 ↑ 1.0 16 1

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

118. 0.008 0.047 ↑ 1.0 63 1

Hash (cost=10.63..10.63 rows=63 width=24) (actual time=0.047..0.047 rows=63 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
119. 0.013 0.039 ↑ 1.0 63 1

Merge Left Join (cost=0.43..10.63 rows=63 width=24) (actual time=0.011..0.039 rows=63 loops=1)

  • Merge Cond: (salesperson.id = salesperson_partner.id)
120. 0.010 0.010 ↑ 1.0 63 1

Index Only Scan using res_users_pkey on res_users salesperson (cost=0.14..9.09 rows=63 width=4) (actual time=0.005..0.010 rows=63 loops=1)

  • Heap Fetches: 0
121. 0.016 0.016 ↑ 1,633.6 9 1

Index Scan using res_partner_pkey on res_partner salesperson_partner (cost=0.29..3,406.78 rows=14,702 width=24) (actual time=0.005..0.016 rows=9 loops=1)

122. 0.004 0.011 ↑ 1.0 28 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
123. 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.003..0.007 rows=28 loops=1)

124. 0.000 0.000 ↓ 0.0 0 371

Index Scan using res_partner_pkey on res_partner school (cost=0.29..4.85 rows=1 width=24) (actual time=0.000..0.000 rows=0 loops=371)

  • Index Cond: (wo.school_id = id)
125. 0.000 0.000 ↑ 2.3 3 371

Materialize (cost=0.00..1.10 rows=7 width=16) (actual time=0.000..0.000 rows=3 loops=371)

126. 0.004 0.004 ↑ 1.2 6 1

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

127. 0.371 0.371 ↑ 1.0 1 371

Index Scan using res_partner_pkey on res_partner parent (cost=0.29..0.53 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=371)

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

SubPlan (for Nested Loop Left Join)

129. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=21.55..21.56 rows=1 width=32) (never executed)

130. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (root_wo = wo.id)
131. 0.371 36.358 ↑ 1.0 1 371

Aggregate (cost=21.55..21.56 rows=1 width=32) (actual time=0.098..0.098 rows=1 loops=371)

132. 35.987 35.987 ↑ 5.0 1 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_8 (cost=0.00..21.53 rows=5 width=4) (actual time=0.057..0.097 rows=1 loops=371)

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

Aggregate (cost=21.54..21.55 rows=1 width=4) (never executed)

134. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (root_wo = wo.id)
135. 0.371 26.341 ↑ 1.0 1 371

Aggregate (cost=21.54..21.55 rows=1 width=4) (actual time=0.071..0.071 rows=1 loops=371)

136. 25.970 25.970 ↑ 5.0 1 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_9 (cost=0.00..21.53 rows=5 width=4) (actual time=0.036..0.070 rows=1 loops=371)

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

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

138. 0.000 0.000 ↓ 0.0 0

Sort (cost=21.62..21.63 rows=5 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
139. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (root_wo = wo.id)
140. 0.371 27.083 ↑ 1.0 1 371

Limit (cost=21.62..21.62 rows=1 width=36) (actual time=0.073..0.073 rows=1 loops=371)

141. 0.371 26.712 ↑ 5.0 1 371

Sort (cost=21.62..21.63 rows=5 width=36) (actual time=0.072..0.072 rows=1 loops=371)

  • 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
142. 26.341 26.341 ↑ 5.0 1 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_10 (cost=0.00..21.59 rows=5 width=36) (actual time=0.036..0.071 rows=1 loops=371)

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

Result (cost=23.93..23.94 rows=1 width=1) (never executed)

144.          

Initplan (for Result)

145. 0.000 0.000 ↓ 0.0 0

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

  • Filter: ((root_wo = wo.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
146. 0.000 18.921 ↑ 1.0 1 371

Result (cost=23.93..23.94 rows=1 width=1) (actual time=0.051..0.051 rows=1 loops=371)

147.          

Initplan (for Result)

148. 18.921 18.921 ↑ 1.0 1 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_11 (cost=0.00..23.93 rows=1 width=0) (actual time=0.051..0.051 rows=1 loops=371)

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

Result (cost=10.77..10.78 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_12 (cost=0.00..21.53 rows=2 width=0) (never executed)

  • Filter: (has_been_assigned AND (root_wo = wo.id))
152. 0.371 32.277 ↑ 1.0 1 371

Result (cost=10.77..10.78 rows=1 width=1) (actual time=0.087..0.087 rows=1 loops=371)

153.          

Initplan (for Result)

154. 31.906 31.906 ↓ 0.0 0 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_12 (cost=0.00..21.53 rows=2 width=0) (actual time=0.086..0.086 rows=0 loops=371)

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

Aggregate (cost=23.94..23.95 rows=1 width=32) (never executed)

156. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo.id))
157. 0.371 35.245 ↑ 1.0 1 371

Aggregate (cost=23.94..23.95 rows=1 width=32) (actual time=0.095..0.095 rows=1 loops=371)

158. 34.874 34.874 ↑ 5.0 1 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_13 (cost=0.00..23.93 rows=5 width=32) (actual time=0.056..0.094 rows=1 loops=371)

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

Result (cost=5.26..5.27 rows=1 width=1) (never executed)

160.          

Initplan (for Result)

161. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo.id))
162. 0.371 47.117 ↑ 1.0 1 371

Result (cost=5.26..5.27 rows=1 width=1) (actual time=0.126..0.127 rows=1 loops=371)

163.          

Initplan (for Result)

164. 46.746 46.746 ↓ 0.0 0 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_14 (cost=0.00..26.32 rows=5 width=0) (actual time=0.126..0.126 rows=0 loops=371)

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

Result (cost=33.50..33.51 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_15 (cost=0.00..33.50 rows=1 width=0) (never executed)

  • Filter: ((root_wo = wo.id) AND ('progress'::text = ANY ((states)::text[])))
168. 0.000 38.955 ↑ 1.0 1 371

Result (cost=33.50..33.51 rows=1 width=1) (actual time=0.105..0.105 rows=1 loops=371)

169.          

Initplan (for Result)

170. 38.955 38.955 ↓ 0.0 0 371

CTE Scan on non_sus_associated_workorders non_sus_associated_workorders_15 (cost=0.00..33.50 rows=1 width=0) (actual time=0.105..0.105 rows=0 loops=371)

  • Filter: ((root_wo = wo.id) AND ('progress'::text = ANY ((states)::text[])))
  • Rows Removed by Filter: 886
171. 0.260 33.662 ↓ 35.0 35 1

Nested Loop Left Join (cost=2.24..359.20 rows=1 width=419) (actual time=8.836..33.662 rows=35 loops=1)

172. 0.035 3.232 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.96..34.25 rows=1 width=326) (actual time=2.240..3.232 rows=35 loops=1)

173. 0.060 3.162 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.67..25.95 rows=1 width=306) (actual time=2.236..3.162 rows=35 loops=1)

  • Join Filter: (a_1.design_process_id = dp_1.id)
  • Rows Removed by Join Filter: 35
174. 0.039 3.067 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.67..24.79 rows=1 width=294) (actual time=2.231..3.067 rows=35 loops=1)

175. 0.019 2.993 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.54..23.83 rows=1 width=266) (actual time=2.226..2.993 rows=35 loops=1)

176. 0.099 2.799 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.11..22.87 rows=1 width=246) (actual time=2.214..2.799 rows=35 loops=1)

  • Join Filter: (wo_1.workcenter_id = wc_1.id)
  • Rows Removed by Join Filter: 525
177. 0.022 2.630 ↓ 35.0 35 1

Nested Loop Left Join (cost=1.11..21.51 rows=1 width=242) (actual time=2.207..2.630 rows=35 loops=1)

178. 0.023 2.573 ↓ 35.0 35 1

Nested Loop Left Join (cost=0.97..21.33 rows=1 width=210) (actual time=2.202..2.573 rows=35 loops=1)

179. 0.020 2.550 ↓ 35.0 35 1

Nested Loop Left Join (cost=0.84..21.11 rows=1 width=178) (actual time=2.200..2.550 rows=35 loops=1)

180. 0.017 2.390 ↓ 35.0 35 1

Nested Loop Left Join (cost=0.41..8.50 rows=1 width=130) (actual time=2.192..2.390 rows=35 loops=1)

181. 2.198 2.198 ↓ 35.0 35 1

CTE Scan on sus_squished_mrp_workorders wo_1 (cost=0.00..0.02 rows=1 width=29) (actual time=2.183..2.198 rows=35 loops=1)

  • Filter: sus_web
182. 0.175 0.175 ↑ 1.0 1 35

Nested Loop Left Join (cost=0.41..8.47 rows=1 width=109) (actual time=0.004..0.005 rows=1 loops=35)

  • -> Index Scan using kingfisher_artwork_order_pkey on kingfisher_artwork_order ao_1 (cost=0.28..8.29 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=3
  • Index Cond: (wo_1.artwork_order_id = id)
  • -> Index Scan using kingfisher_artwork_properties_pkey on kingfisher_artwork_properties a_1 (cost=0.14..0.17 rows=1 width=101) (actual time=0.001..0.001 rows
  • Index Cond: (ao_1.artwork_id = id)
183. 0.045 0.140 ↑ 1.0 1 35

Nested Loop Left Join (cost=0.43..12.61 rows=1 width=52) (actual time=0.004..0.004 rows=1 loops=35)

184. 0.035 0.035 ↑ 1.0 1 35

Index Scan using sale_order_pkey on sale_order so_1 (cost=0.14..8.16 rows=1 width=28) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (wo_1.sale_order_id = id)
185. 0.060 0.060 ↑ 1.0 1 30

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

  • Index Cond: (so_1.partner_id = id)
186. 0.000 0.000 ↓ 0.0 0 35

Index Scan using sale_order_priority_pkey on sale_order_priority sop_1 (cost=0.13..0.20 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=35)

  • Index Cond: (so_1.priority = id)
187. 0.035 0.035 ↑ 1.0 1 35

Index Scan using kingfisher_artwork_position_pkey on kingfisher_artwork_position ap_1 (cost=0.14..0.17 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (ao_1.design_position_id = id)
188. 0.070 0.070 ↑ 1.0 16 35

Seq Scan on mrp_workcenter wc_1 (cost=0.00..1.16 rows=16 width=8) (actual time=0.001..0.002 rows=16 loops=35)

189. 0.050 0.175 ↑ 1.0 1 35

Merge Left Join (cost=0.43..0.96 rows=1 width=24) (actual time=0.004..0.005 rows=1 loops=35)

  • Merge Cond: (salesperson_1.id = salesperson_partner_1.id)
190. 0.035 0.035 ↑ 1.0 1 35

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

  • Index Cond: (id = so_1.user_id)
  • Heap Fetches: 0
191. 0.090 0.090 ↑ 14,702.0 1 30

Index Scan using res_partner_pkey on res_partner salesperson_partner_1 (cost=0.29..3,406.78 rows=14,702 width=24) (actual time=0.003..0.003 rows=1 loops=30)

192. 0.035 0.035 ↑ 1.0 1 35

Index Scan using resource_resource_pkey on resource_resource resource_1 (cost=0.14..0.90 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (wc_1.resource_id = id)
193. 0.035 0.035 ↑ 3.5 2 35

Seq Scan on kingfisher_artwork_design_process dp_1 (cost=0.00..1.07 rows=7 width=16) (actual time=0.001..0.001 rows=2 loops=35)

194. 0.035 0.035 ↑ 1.0 1 35

Index Scan using res_partner_pkey on res_partner school_1 (cost=0.29..8.30 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (wo_1.school_id = id)
195. 0.000 0.000 ↓ 0.0 0 35

Index Scan using res_partner_pkey on res_partner parent_1 (cost=0.29..0.53 rows=1 width=24) (actual time=0.000..0.000 rows=0 loops=35)

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

SubPlan (for Nested Loop Left Join)

197. 0.035 8.225 ↑ 1.0 1 35

Aggregate (cost=21.55..21.56 rows=1 width=32) (actual time=0.235..0.235 rows=1 loops=35)

198. 8.190 8.190 ↑ 5.0 1 35

CTE Scan on sus_associated_workorders (cost=0.00..21.53 rows=5 width=4) (actual time=0.176..0.234 rows=1 loops=35)

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

Aggregate (cost=21.55..21.56 rows=1 width=32) (never executed)

200. 0.000 0.000 ↓ 0.0 0

CTE Scan on non_sus_associated_workorders (cost=0.00..21.53 rows=5 width=4) (never executed)

  • Filter: (root_wo = wo_1.id)
201. 0.000 2.310 ↑ 1.0 1 35

Aggregate (cost=21.54..21.55 rows=1 width=4) (actual time=0.066..0.066 rows=1 loops=35)

202. 2.310 2.310 ↑ 5.0 1 35

CTE Scan on sus_associated_workorders sus_associated_workorders_1 (cost=0.00..21.53 rows=5 width=4) (actual time=0.043..0.066 rows=1 loops=35)

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

Aggregate (cost=21.54..21.55 rows=1 width=4) (never executed)

204. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (root_wo = wo_1.id)
205. 0.035 2.380 ↑ 1.0 1 35

Limit (cost=21.62..21.62 rows=1 width=36) (actual time=0.068..0.068 rows=1 loops=35)

206. 0.070 2.345 ↑ 5.0 1 35

Sort (cost=21.62..21.63 rows=5 width=36) (actual time=0.067..0.067 rows=1 loops=35)

  • 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
207. 2.275 2.275 ↑ 5.0 1 35

CTE Scan on sus_associated_workorders sus_associated_workorders_2 (cost=0.00..21.59 rows=5 width=36) (actual time=0.043..0.065 rows=1 loops=35)

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

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

209. 0.000 0.000 ↓ 0.0 0

Sort (cost=21.62..21.63 rows=5 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
210. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (root_wo = wo_1.id)
211. 0.000 1.995 ↑ 1.0 1 35

Result (cost=23.93..23.94 rows=1 width=1) (actual time=0.057..0.057 rows=1 loops=35)

212.          

Initplan (for Result)

213. 1.995 1.995 ↑ 1.0 1 35

CTE Scan on sus_associated_workorders sus_associated_workorders_3 (cost=0.00..23.93 rows=1 width=0) (actual time=0.057..0.057 rows=1 loops=35)

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

Result (cost=23.93..23.94 rows=1 width=1) (never executed)

215.          

Initplan (for Result)

216. 0.000 0.000 ↓ 0.0 0

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

  • Filter: ((root_wo = wo_1.id) AND ((workcenter_name)::text = 'Unallocated Workcenter'::text))
217. 0.000 3.045 ↑ 1.0 1 35

Result (cost=10.77..10.78 rows=1 width=1) (actual time=0.087..0.087 rows=1 loops=35)

218.          

Initplan (for Result)

219. 3.045 3.045 ↓ 0.0 0 35

CTE Scan on sus_associated_workorders sus_associated_workorders_4 (cost=0.00..21.53 rows=2 width=0) (actual time=0.087..0.087 rows=0 loops=35)

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

Result (cost=10.77..10.78 rows=1 width=1) (never executed)

221.          

Initplan (for Result)

222. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (has_been_assigned AND (root_wo = wo_1.id))
223. 0.035 3.185 ↑ 1.0 1 35

Aggregate (cost=23.94..23.95 rows=1 width=32) (actual time=0.091..0.091 rows=1 loops=35)

224. 3.150 3.150 ↑ 5.0 1 35

CTE Scan on sus_associated_workorders sus_associated_workorders_5 (cost=0.00..23.93 rows=5 width=32) (actual time=0.074..0.090 rows=1 loops=35)

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

Aggregate (cost=23.94..23.95 rows=1 width=32) (never executed)

226. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (((state)::text <> 'done'::text) AND (root_wo = wo_1.id))
227. 0.000 5.390 ↑ 1.0 1 35

Result (cost=5.26..5.27 rows=1 width=1) (actual time=0.154..0.154 rows=1 loops=35)

228.          

Initplan (for Result)

229. 5.390 5.390 ↓ 0.0 0 35

CTE Scan on sus_associated_workorders sus_associated_workorders_6 (cost=0.00..26.32 rows=5 width=0) (actual time=0.154..0.154 rows=0 loops=35)

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

Result (cost=5.26..5.27 rows=1 width=1) (never executed)

231.          

Initplan (for Result)

232. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (((state)::text <> ALL ('{done,cancel}'::text[])) AND ((production_availability)::text <> 'assigned'::text) AND (root_wo = wo_1.id))
233. 0.000 3.640 ↑ 1.0 1 35

Result (cost=33.50..33.51 rows=1 width=1) (actual time=0.104..0.104 rows=1 loops=35)

234.          

Initplan (for Result)

235. 3.640 3.640 ↓ 0.0 0 35

CTE Scan on sus_associated_workorders sus_associated_workorders_7 (cost=0.00..33.50 rows=1 width=0) (actual time=0.104..0.104 rows=0 loops=35)

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

Result (cost=33.50..33.51 rows=1 width=1) (never executed)

237.          

Initplan (for Result)

238. 0.000 0.000 ↓ 0.0 0

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

  • Filter: ((root_wo = wo_1.id) AND ('progress'::text = ANY ((states)::text[])))
Planning time : 11.986 ms
Execution time : 307.422 ms