explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wlrD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0 3 1

Subquery Scan on vw (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

2. 0.000 0.000 ↓ 0.0 3 1

Sort (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

  • Sort Key: (prep_natural_sort(pp.positionnumber)), pp."position", (prep_natural_sort((act.number)::text))
  • Sort Method: quicksort Memory: 26kB
3. 0.000 0.000 ↓ 0.0 3 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

4. 0.000 0.000 ↓ 0.0 3 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

  • Hash Cond: (p.projectgroup_id = pg.id)
5. 0.000 0.000 ↓ 0.0 3 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

  • Hash Cond: ("*SELECT* 1".activity_id = act.id)
6. 0.000 0.000 ↓ 0.0 3 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

7. 0.000 0.000 ↓ 0.0 3 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

8. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

9. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Join Filter: (p.tenant_id = tenant.id)
  • Rows Removed by Join Filter: 3
10. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

11. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

12. 0.000 0.000 ↓ 0.0 1 1

Index Scan using project_pkey on project p (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (id = 6,583)
13. 0.000 0.000 ↓ 0.0 1 1

Index Scan using idx_company_displayname on company (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (id = p.customer_id)
14. 0.000 0.000 ↓ 0.0 1 1

Index Scan using address_pkey on address adr (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (company.defaultaddress_id = id)
15. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on tenant (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

16. 0.000 0.000 ↓ 0.0 1 1

Index Only Scan using idx_currency_displayname on currency curr (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (id = tenant.defaultcurrency_id)
  • Heap Fetches: 1
17. 0.000 0.000 ↓ 0.0 3 1

Append (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

18. 0.000 0.000 ↓ 0.0 1 1

Subquery Scan on *SELECT* 1 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

19. 0.000 0.000 ↓ 0.0 1 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Group Key: p_1.id, pp_1.id, ccosts.sumcosts, ccosts.sumcostsexternal
20. 0.000 0.000 ↓ 0.0 2 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=2 loops=1)

21. 0.000 0.000 ↓ 0.0 1 1

Index Only Scan using project_pkey on project p_1 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (id = 6,583)
  • Heap Fetches: 1
22. 0.000 0.000 ↓ 0.0 2 1

Hash Right Join (cost=0..0 rows=0 width=0) (actual rows=2 loops=1)

  • Hash Cond: ((COALESCE(pp_2.id, realdata.projectpart_id)) = pp_1.id)
23. 0.000 0.000 ↓ 0.0 201,243 1

Merge Left Join (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Merge Cond: ((COALESCE(pp_2.id, realdata.projectpart_id)) = sb.projectpart_id)
24. 0.000 0.000 ↓ 0.0 201,243 1

Sort (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Sort Key: (COALESCE(pp_2.id, realdata.projectpart_id))
  • Sort Method: external sort Disk: 10,328kB
25. 0.000 0.000 ↓ 0.0 201,243 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Hash Cond: ((COALESCE(preplanned.activity_id, pa.task_id, realdata.activity_id)) = act_1.id)
26. 0.000 0.000 ↓ 0.0 201,242 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=201,242 loops=1)

  • Hash Cond: (COALESCE(preplanned.project_id, p_3.id, realdata.project_id) = p_2.id)
27. 0.000 0.000 ↓ 0.0 200,301 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=200,301 loops=1)

  • Hash Cond: ((p_3.id = realdata.project_id) AND (pp_2.id = realdata.projectpart_id) AND (pa.task_id = realdata.activity_id))
  • Join Filter: (NOT ((pa.finished OR ((p_3.status)::text = 'DONE'::text))))
  • Rows Removed by Join Filter: 71,206
28. 0.000 0.000 ↓ 0.0 116,388 1

Merge Full Join (cost=0..0 rows=0 width=0) (actual rows=116,388 loops=1)

  • Merge Cond: ((p_3.id = preplanned.project_id) AND (pp_2.id = preplanned.projectpart_id) AND (pa.task_id = preplanned.activity_id))
29. 0.000 0.000 ↓ 0.0 84,612 1

GroupAggregate (cost=0..0 rows=0 width=0) (actual rows=84,612 loops=1)

  • Group Key: p_3.id, pp_2.id, pa.task_id, pa.finished
30. 0.000 0.000 ↓ 0.0 90,130 1

Sort (cost=0..0 rows=0 width=0) (actual rows=90,130 loops=1)

  • Sort Key: p_3.id, pp_2.id, pa.task_id, pa.finished
  • Sort Method: external merge Disk: 2,536kB
31. 0.000 0.000 ↓ 0.0 90,130 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=90,130 loops=1)

  • Hash Cond: (pp_2.project_id = p_3.id)
32. 0.000 0.000 ↓ 0.0 90,144 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=90,144 loops=1)

  • Hash Cond: (pa.projectpart_id = pp_2.id)
33. 0.000 0.000 ↓ 0.0 90,144 1

Seq Scan on projectactivity pa (cost=0..0 rows=0 width=0) (actual rows=90,144 loops=1)

  • Filter: ((NOT preliminary) AND (NOT external) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 112,525
34. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,843kB
35. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_2 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
36. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 320kB
37. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_3 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

38. 0.000 0.000 ↓ 0.0 31,776 1

Sort (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

  • Sort Key: preplanned.project_id, preplanned.projectpart_id, preplanned.activity_id
  • Sort Method: quicksort Memory: 2,258kB
39. 0.000 0.000 ↓ 0.0 31,776 1

Subquery Scan on preplanned (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

40. 0.000 0.000 ↓ 0.0 31,776 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

  • Group Key: p_4.id, pa_1.task_id
41. 0.000 0.000 ↓ 0.0 82,347 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=82,347 loops=1)

  • Hash Cond: (pp_3.project_id = p_4.id)
42. 0.000 0.000 ↓ 0.0 83,095 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=83,095 loops=1)

  • Hash Cond: (pa_1.projectpart_id = pp_3.id)
43. 0.000 0.000 ↓ 0.0 83,095 1

Seq Scan on projectactivity pa_1 (cost=0..0 rows=0 width=0) (actual rows=83,095 loops=1)

  • Filter: (preliminary AND (NOT external) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 119,574
44. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,843kB
45. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_3 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
46. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 286kB
47. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_4 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

48. 0.000 0.000 ↓ 0.0 84,366 1

Hash (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

  • Buckets: 32,768 Batches: 2 Memory Usage: 3,252kB
49. 0.000 0.000 ↓ 0.0 84,366 1

Subquery Scan on realdata (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

50. 0.000 0.000 ↓ 0.0 84,366 1

GroupAggregate (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

  • Group Key: pac.project_id, (COALESCE(pac.projectpart_id, pp_4.id)), pac.activity_id
51. 0.000 0.000 ↓ 0.0 197,072 1

Sort (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Sort Key: pac.project_id, (COALESCE(pac.projectpart_id, pp_4.id)), pac.activity_id
  • Sort Method: external merge Disk: 9,592kB
52. 0.000 0.000 ↓ 0.0 197,072 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Hash Cond: (pa_2.projectpart_id = pp_4.id)
53. 0.000 0.000 ↓ 0.0 197,072 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Hash Cond: (pac.projectactivity_id = pa_2.id)
54. 0.000 0.000 ↓ 0.0 197,072 1

Seq Scan on projectactivityconfirmation pac (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Filter: (COALESCE((date <= (get_session_var('calcdate'::character varying))::date), true) AND COALESCE((date >= (get (...)
55. 0.000 0.000 ↓ 0.0 202,669 1

Hash (cost=0..0 rows=0 width=0) (actual rows=202,669 loops=1)

  • Buckets: 131,072 Batches: 4 Memory Usage: 3,018kB
56. 0.000 0.000 ↓ 0.0 202,669 1

Seq Scan on projectactivity pa_2 (cost=0..0 rows=0 width=0) (actual rows=202,669 loops=1)

57. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,562kB
58. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_4 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
59. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 286kB
60. 0.000 0.000 ↓ 0.0 6,288 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Hash Cond: (p_2.id = subq.project_id)
61. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_2 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

62. 0.000 0.000 ↓ 0.0 6,099 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 279kB
63. 0.000 0.000 ↓ 0.0 6,099 1

Subquery Scan on subq (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Filter: (subq.rank = 1)
  • Rows Removed by Filter: 13,330
64. 0.000 0.000 ↓ 0.0 19,429 1

WindowAgg (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

65. 0.000 0.000 ↓ 0.0 19,429 1

Sort (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

  • Sort Key: projectstatuschange.project_id, projectstatuschange.startdate DESC
  • Sort Method: quicksort Memory: 1,679kB
66. 0.000 0.000 ↓ 0.0 19,429 1

Seq Scan on projectstatuschange (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

  • Filter: ((recordstatus <> 'X'::recordstatus) AND COALESCE(((startdate)::date <= (get_session_var('calcdate'::character var (...)
  • Rows Removed by Filter: 26
67. 0.000 0.000 ↓ 0.0 79 1

Hash (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
68. 0.000 0.000 ↓ 0.0 79 1

Seq Scan on activity act_1 (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

69. 0.000 0.000 ↓ 0.0 1 1

Sort (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Sort Key: sb.projectpart_id
  • Sort Method: quicksort Memory: 968kB
70. 0.000 0.000 ↓ 0.0 12,455 1

Seq Scan on stockbooking sb (cost=0..0 rows=0 width=0) (actual rows=12,455 loops=1)

71. 0.000 0.000 ↓ 0.0 1 1

Hash (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
72. 0.000 0.000 ↓ 0.0 1 1

Merge Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Merge Cond: (pp_1.id = ccosts.projectpart_id)
73. 0.000 0.000 ↓ 0.0 1 1

Sort (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Sort Key: pp_1.id
  • Sort Method: quicksort Memory: 25kB
74. 0.000 0.000 ↓ 0.0 1 1

Index Scan using idx_projectpart_project_id on projectpart pp_1 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (project_id = 6,583)
  • Filter: (NOT preliminary)
  • Rows Removed by Filter: 1
75. 0.000 0.000 ↓ 0.0 7,512 1

Sort (cost=0..0 rows=0 width=0) (actual rows=7,512 loops=1)

  • Sort Key: ccosts.projectpart_id
  • Sort Method: quicksort Memory: 809kB
76. 0.000 0.000 ↓ 0.0 8,155 1

Subquery Scan on ccosts (cost=0..0 rows=0 width=0) (actual rows=8,155 loops=1)

77. 0.000 0.000 ↓ 0.0 8,155 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=8,155 loops=1)

  • Group Key: p_5.id, pc.projectpart_id, cu.id, cu.name, cu.number, (COALESCE(pc.tenant_id, p_5.tenant_id))
78. 0.000 0.000 ↓ 0.0 19,206 1

Append (cost=0..0 rows=0 width=0) (actual rows=19,206 loops=1)

79. 0.000 0.000 ↓ 0.0 17,856 1

Result (cost=0..0 rows=0 width=0) (actual rows=17,856 loops=1)

80. 0.000 0.000 ↓ 0.0 17,856 1

Append (cost=0..0 rows=0 width=0) (actual rows=17,856 loops=1)

81. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_5.id, pc.projectpart_id, cu.id, cu.name, cu.number, COALESCE(pc.tenant_id, p_5.tenant_id), pc.orderdate
82. 0.000 0.000 ↓ 0.0 0 1

Hash Right Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (pc.project_id = p_5.id)
  • Filter: (COALESCE((pc.orderdate <= (get_session_var('calcdate'::character varying))::date), true) AND COALESCE((pc.orderdate >= (...)
83. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on projectcomponent pc (cost=0..0 rows=0 width=0) (never executed)

  • Recheck Cond: (recordstatus <> 'X'::recordstatus)
  • Filter: ((NOT preliminary) AND (bookedquantity = '0'::double precision))
84. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_projectcomponent_notpreliminary (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (preliminary = false)
85. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
86. 0.000 0.000 ↓ 0.0 0 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (p_5.costunit_id = cu.id)
87. 0.000 0.000 ↓ 0.0 0 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (p_5.tenant_id = t.id)
88. 0.000 0.000 ↓ 0.0 1 1

Seq Scan on project p_5 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

89. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
90. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t.configuration_id = c.id)
91. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on configuration c (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: ((NOT useinvoicesforprojectcalculation) AND (NOT onlyusebookedcomponentsforprojectca (...)
  • Rows Removed by Filter: 4
92. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t (cost=0..0 rows=0 width=0) (never executed)

93. 0.000 0.000 ↓ 0.0 0

Hash (cost=0..0 rows=0 width=0) (never executed)

94. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu (cost=0..0 rows=0 width=0) (never executed)

95. 0.000 0.000 ↓ 0.0 11,800 1

Subquery Scan on *SELECT* 2 (cost=0..0 rows=0 width=0) (actual rows=11,800 loops=1)

96. 0.000 0.000 ↓ 0.0 11,800 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=11,800 loops=1)

  • Group Key: p_6.id, cu_1.id, cu_1.name, cu_1.number, COALESCE(pc_1.tenant_id, p_6.tenant_id), pi.id, pii.positionnumber, pc_1.id
97. 0.000 0.000 ↓ 0.0 11,802 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=11,802 loops=1)

  • Hash Cond: (p_6.costunit_id = cu_1.id)
98. 0.000 0.000 ↓ 0.0 11,802 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=11,802 loops=1)

  • Join Filter: (pois.id IS NULL)
  • Rows Removed by Join Filter: 3
  • Filter: ((pc_1.* IS NULL) OR (pc_1.bookedquantity = '0'::double precision) OR (NOT c_1.ignorepurchaseinvoicesoncompo (...)
99. 0.000 0.000 ↓ 0.0 11,802 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=11,802 loops=1)

  • Hash Cond: (COALESCE(pois.project_id, pii.project_id, pi.project_id) = p_6.id)
100. 0.000 0.000 ↓ 0.0 11,964 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=11,964 loops=1)

  • Hash Cond: (pii.id = pois.purchaseinvoiceitem_id)
101. 0.000 0.000 ↓ 0.0 11,962 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=11,962 loops=1)

  • Hash Cond: (pii.purchaseinvoice_id = pi.id)
102. 0.000 0.000 ↓ 0.0 11,962 1

Seq Scan on purchaseinvoiceitem pii (cost=0..0 rows=0 width=0) (actual rows=11,962 loops=1)

  • Filter: ((recordstatus <> 'X'::recordstatus) AND ((status)::text <> ALL ('{ENTRY,CANCELLED}' (...)
  • Rows Removed by Filter: 177
103. 0.000 0.000 ↓ 0.0 5,008 1

Hash (cost=0..0 rows=0 width=0) (actual rows=5,008 loops=1)

  • Buckets: 8,192 (originally 2048) Batches: 1 (originally 1) Memory Usage: 422kB
104. 0.000 0.000 ↓ 0.0 5,008 1

Seq Scan on purchaseinvoice pi (cost=0..0 rows=0 width=0) (actual rows=5,008 loops=1)

  • Filter: (((status)::text = 'READY'::text) AND (date >= (COALESCE(get_session_var('star (...)
  • Rows Removed by Filter: 144
105. 0.000 0.000 ↓ 0.0 3 1

Hash (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
106. 0.000 0.000 ↓ 0.0 6 1

Seq Scan on purchaseorderitemsplit pois (cost=0..0 rows=0 width=0) (actual rows=6 loops=1)

107. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 (originally 2048) Batches: 1 (originally 1) Memory Usage: 317kB
108. 0.000 0.000 ↓ 0.0 6,288 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Hash Cond: (p_6.tenant_id = t_1.id)
109. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_6 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

110. 0.000 0.000 ↓ 0.0 4 1

Hash (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
111. 0.000 0.000 ↓ 0.0 4 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Join Filter: (t_1.configuration_id = c_1.id)
  • Rows Removed by Join Filter: 12
112. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on configuration c_1 (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Filter: (useinvoicesforprojectcalculation AND (NOT onlyusebookedcomponentsforpro (...)
113. 0.000 0.000 ↓ 0.0 4 4

Seq Scan on tenant t_1 (cost=0..0 rows=0 width=0) (actual rows=4 loops=4)

114. 0.000 0.000 ↓ 0.0 1 11,802

Index Scan using projectcomponent_pkey on projectcomponent pc_1 (cost=0..0 rows=0 width=0) (actual rows=1 loops=11,802)

  • Index Cond: (id = pii.projectcomponent_id)
  • Filter: ((NOT preliminary) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 0
115. 0.000 0.000 ↓ 0.0 16 1

Hash (cost=0..0 rows=0 width=0) (actual rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
116. 0.000 0.000 ↓ 0.0 16 1

Seq Scan on costunit cu_1 (cost=0..0 rows=0 width=0) (actual rows=16 loops=1)

117. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

118. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_7.id, cu_2.id, cu_2.name, cu_2.number, COALESCE(pc_2.tenant_id, p_7.tenant_id), po.id, poi.positionnumber, pc_2.id
119. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (cu_2.id = p_7.costunit_id)
120. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (pois_1.id IS NULL)
  • Filter: ((pc_2.* IS NULL) OR (pc_2.bookedquantity = '0'::double precision) OR (NOT c_2.ignorepurchaseinvoicesoncompo (...)
121. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_2.id = p_7.tenant_id)
122. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (pois_1.purchaseorderitem_id = poi.id)
123. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

124. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_2.configuration_id = c_2.id)
125. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on configuration c_2 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: (useinvoicesforprojectcalculation AND useinvoicesorordersforprojectcalculation (...)
  • Rows Removed by Filter: 4
126. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t_2 (cost=0..0 rows=0 width=0) (never executed)

127. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0..0 rows=0 width=0) (never executed)

  • -> Index Scan using idx_purchaseorderitem_purchaseorder_id on purchaseorderitem poi (never (...)
128. 0.000 0.000 ↓ 0.0 0

Seq Scan on purchaseorder po (cost=0..0 rows=0 width=0) (never executed)

  • Filter: (((status)::text = 'READY'::text) AND (date >= (COALESCE(get_session_var('star (...)
  • Index Cond: (purchaseorder_id = po.id)
  • Filter: ((recordstatus <> 'X'::recordstatus) AND ((status)::text <> ALL ('{ENTRY,CANCE (...)
129. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0..0 rows=0 width=0) (never executed)

130. 0.000 0.000 ↓ 0.0 0

Seq Scan on purchaseorderitemsplit pois_1 (cost=0..0 rows=0 width=0) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Index Scan using project_pkey on project p_7 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = COALESCE(pois_1.project_id, poi.project_id))
132. 0.000 0.000 ↓ 0.0 0

Index Scan using projectcomponent_pkey on projectcomponent pc_2 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = poi.projectcomponent_id)
  • Filter: ((NOT preliminary) AND (recordstatus <> 'X'::recordstatus))
133. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0..0 rows=0 width=0) (never executed)

134. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu_2 (cost=0..0 rows=0 width=0) (never executed)

135. 0.000 0.000 ↓ 0.0 6,056 1

Subquery Scan on *SELECT* 4 (cost=0..0 rows=0 width=0) (actual rows=6,056 loops=1)

136. 0.000 0.000 ↓ 0.0 6,056 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=6,056 loops=1)

  • Group Key: pc_3.id, cu_3.id, p_8.id, pa_3.id
137. 0.000 0.000 ↓ 0.0 6,056 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=6,056 loops=1)

  • Join Filter: (CASE WHEN c_3.useinvoicesorordersforprojectcalculation THEN (poi_1.id IS NULL) ELSE true END AND (t_3.config (...)
  • Rows Removed by Join Filter: 9,533
138. 0.000 0.000 ↓ 0.0 15,589 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=15,589 loops=1)

139. 0.000 0.000 ↓ 0.0 15,589 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=15,589 loops=1)

140. 0.000 0.000 ↓ 0.0 15,589 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=15,589 loops=1)

141. 0.000 0.000 ↓ 0.0 15,589 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=15,589 loops=1)

142. 0.000 0.000 ↓ 0.0 15,594 1

Hash Right Join (cost=0..0 rows=0 width=0) (actual rows=15,594 loops=1)

  • Hash Cond: (poi_1.projectcomponent_id = pc_3.id)
143. 0.000 0.000 ↓ 0.0 13,216 1

Seq Scan on purchaseorderitem poi_1 (cost=0..0 rows=0 width=0) (actual rows=13,216 loops=1)

  • Filter: (((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[])) AND (recordstatus <> 'X (...)
  • Rows Removed by Filter: 805
144. 0.000 0.000 ↓ 0.0 15,590 1

Hash (cost=0..0 rows=0 width=0) (actual rows=15,590 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,301kB
145. 0.000 0.000 ↓ 0.0 15,590 1

Hash Right Join (cost=0..0 rows=0 width=0) (actual rows=15,590 loops=1)

  • Hash Cond: (pii_1.projectcomponent_id = pc_3.id)
  • Filter: (pii_1.id IS NULL)
  • Rows Removed by Filter: 11,470
146. 0.000 0.000 ↓ 0.0 11,962 1

Seq Scan on purchaseinvoiceitem pii_1 (cost=0..0 rows=0 width=0) (actual rows=11,962 loops=1)

  • Filter: (((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[])) AND (record (...)
  • Rows Removed by Filter: 177
147. 0.000 0.000 ↓ 0.0 26,726 1

Hash (cost=0..0 rows=0 width=0) (actual rows=26,726 loops=1)

  • Buckets: 32,768 (originally 8192) Batches: 1 (originally 1) Memory Usage: (...)
148. 0.000 0.000 ↓ 0.0 26,726 1

Bitmap Heap Scan on projectcomponent pc_3 (cost=0..0 rows=0 width=0) (actual rows=26,726 loops=1)

  • Recheck Cond: (recordstatus <> 'X'::recordstatus)
  • Filter: ((NOT preliminary) AND (bookedquantity = '0'::double precisi (...)
  • Heap Blocks: exact=1,326
  • -> Bitmap Index Scan on idx_projectcomponent_notpreliminary (actual (...)
  • Index Cond: (preliminary = false)
149. 0.000 0.000 ↓ 0.0 1 15,594

Index Scan using project_pkey on project p_8 (cost=0..0 rows=0 width=0) (actual rows=1 loops=15,594)

  • Index Cond: (id = pc_3.project_id)
150. 0.000 0.000 ↓ 0.0 0 15,589

Index Scan using idx_costunit_displayname on costunit cu_3 (cost=0..0 rows=0 width=0) (actual rows=0 loops=15,589)

  • Index Cond: (id = p_8.costunit_id)
151. 0.000 0.000 ↓ 0.0 1 15,589

Index Only Scan using projectactivity_pkey on projectactivity pa_3 (cost=0..0 rows=0 width=0) (actual rows=1 loops=15,589)

  • Index Cond: (id = pc_3.projectactivity_id)
  • Heap Fetches: 10,471
152. 0.000 0.000 ↓ 0.0 1 15,589

Index Scan using idx_tenant_displayname on tenant t_3 (cost=0..0 rows=0 width=0) (actual rows=1 loops=15,589)

  • Index Cond: (id = p_8.tenant_id)
153. 0.000 0.000 ↓ 0.0 1 15,589

Seq Scan on configuration c_3 (cost=0..0 rows=0 width=0) (actual rows=1 loops=15,589)

  • Filter: (useprojectcomponentswithoutinvoiceforcalculation AND useinvoicesforprojectcalculation AND (NOT onlyusebooke (...)
  • Rows Removed by Filter: 3
154. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

155. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: pc_4.id, cu_4.id, p_9.id, pa_4.id
156. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

157. 0.000 0.000 ↓ 0.0 0 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (p_9.costunit_id = cu_4.id)
158. 0.000 0.000 ↓ 0.0 0 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (pc_4.article_id = art.id)
  • Filter: ((art.id IS NULL) OR (NOT art.storedinwarehouse))
159. 0.000 0.000 ↓ 0.0 0 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (pc_4.project_id = p_9.id)
160. 0.000 0.000 ↓ 0.0 1 1

Bitmap Heap Scan on projectcomponent pc_4 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Recheck Cond: (recordstatus <> 'X'::recordstatus)
  • Filter: ((NOT preliminary) AND COALESCE((orderdate <= (get_session_var('calcdate'::character varyi (...)
  • Heap Blocks: exact=1
161. 0.000 0.000 ↓ 0.0 26,726 1

Bitmap Index Scan on idx_projectcomponent_notpreliminary (cost=0..0 rows=0 width=0) (actual rows=26,726 loops=1)

  • Index Cond: (preliminary = false)
162. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
163. 0.000 0.000 ↓ 0.0 0 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (p_9.tenant_id = t_4.id)
164. 0.000 0.000 ↓ 0.0 1 1

Seq Scan on project p_9 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

165. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
166. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_4.configuration_id = c_4.id)
167. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on configuration c_4 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: ((NOT useinvoicesforprojectcalculation) AND onlyusebookedcomponent (...)
  • Rows Removed by Filter: 4
168. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t_4 (cost=0..0 rows=0 width=0) (never executed)

169. 0.000 0.000 ↓ 0.0 0

Hash (cost=0..0 rows=0 width=0) (never executed)

170. 0.000 0.000 ↓ 0.0 0

Seq Scan on article art (cost=0..0 rows=0 width=0) (never executed)

171. 0.000 0.000 ↓ 0.0 0

Hash (cost=0..0 rows=0 width=0) (never executed)

172. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu_4 (cost=0..0 rows=0 width=0) (never executed)

173. 0.000 0.000 ↓ 0.0 0

Index Only Scan using projectactivity_pkey on projectactivity pa_4 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = pc_4.projectactivity_id)
  • Heap Fetches: 0
174. 0.000 0.000 ↓ 0.0 1,350 1

Subquery Scan on *SELECT* 6 (cost=0..0 rows=0 width=0) (actual rows=1,350 loops=1)

175. 0.000 0.000 ↓ 0.0 1,350 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=1,350 loops=1)

  • Group Key: COALESCE(p_10.id, pc_5.project_id), pc_5.id, cu_5.id, sb_1.tenant_id, sb_1.date
176. 0.000 0.000 ↓ 0.0 1,472 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

  • Hash Cond: (sb_1.costunit_id = cu_5.id)
177. 0.000 0.000 ↓ 0.0 1,472 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

178. 0.000 0.000 ↓ 0.0 1,472 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

179. 0.000 0.000 ↓ 0.0 1,472 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

180. 0.000 0.000 ↓ 0.0 1,472 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

  • Hash Cond: (sb_1.tenant_id = t_5.id)
181. 0.000 0.000 ↓ 0.0 1,472 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

  • Hash Cond: (sb_1.project_id = p_10.id)
182. 0.000 0.000 ↓ 0.0 12,455 1

Seq Scan on stockbooking sb_1 (cost=0..0 rows=0 width=0) (actual rows=12,455 loops=1)

  • Filter: ((date >= (COALESCE(get_session_var('startdate'::character varying), '1900-01-01'::charact (...)
183. 0.000 0.000 ↓ 0.0 6,099 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 279kB
184. 0.000 0.000 ↓ 0.0 6,099 1

Seq Scan on project p_10 (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 189
185. 0.000 0.000 ↓ 0.0 4 1

Hash (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
186. 0.000 0.000 ↓ 0.0 4 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Hash Cond: (t_5.configuration_id = c_5.id)
187. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on tenant t_5 (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

188. 0.000 0.000 ↓ 0.0 4 1

Hash (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
189. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on configuration c_5 (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

190. 0.000 0.000 ↓ 0.0 1 1,472

Index Scan using projectcomponent_pkey on projectcomponent pc_6 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1,472)

  • Index Cond: (id = sb_1.projectcomponent_id)
  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 0
191. 0.000 0.000 ↓ 0.0 1 1,472

Index Scan using article_pkey on article art_1 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1,472)

  • Index Cond: (id = pc_6.article_id)
192. 0.000 0.000 ↓ 0.0 1 1,472

Index Scan using projectcomponent_pkey on projectcomponent pc_5 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1,472)

  • Index Cond: (id = pc_6.id)
193. 0.000 0.000 ↓ 0.0 16 1

Hash (cost=0..0 rows=0 width=0) (actual rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
194. 0.000 0.000 ↓ 0.0 16 1

Seq Scan on costunit cu_5 (cost=0..0 rows=0 width=0) (actual rows=16 loops=1)

195. 0.000 0.000 ↓ 0.0 2 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=2 loops=1)

  • Group Key: fkt_vw_projectcalculation.project_id, fkt_vw_projectcalculation.activity_id
196. 0.000 0.000 ↓ 0.0 2 1

Subquery Scan on fkt_vw_projectcalculation (cost=0..0 rows=0 width=0) (actual rows=2 loops=1)

  • Filter: ((fkt_vw_projectcalculation.projectpart_id IS NULL) AND (fkt_vw_projectcalculation.project_id = 6,583))
  • Rows Removed by Filter: 201,241
197. 0.000 0.000 ↓ 0.0 201,243 1

Merge Left Join (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Merge Cond: ((COALESCE(pp_5.id, realdata_1.projectpart_id)) = sb_2.projectpart_id)
198. 0.000 0.000 ↓ 0.0 201,243 1

Sort (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Sort Key: (COALESCE(pp_5.id, realdata_1.projectpart_id))
  • Sort Method: external merge Disk: 11,096kB
199. 0.000 0.000 ↓ 0.0 201,243 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=201,243 loops=1)

  • Hash Cond: ((COALESCE(preplanned_1.activity_id, pa_5.task_id, realdata_1.activity_id)) = act_2.id)
200. 0.000 0.000 ↓ 0.0 201,242 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=201,242 loops=1)

  • Hash Cond: (COALESCE(preplanned_1.project_id, p_12.id, realdata_1.project_id) = p_11.id)
201. 0.000 0.000 ↓ 0.0 200,301 1

Hash Full Join (cost=0..0 rows=0 width=0) (actual rows=200,301 loops=1)

  • Hash Cond: ((p_12.id = realdata_1.project_id) AND (pp_5.id = realdata_1.projectpart_id) AND (pa_5.task_id = realdata_1.activity_id))
  • Join Filter: (NOT ((pa_5.finished OR ((p_12.status)::text = 'DONE'::text))))
  • Rows Removed by Join Filter: 71,206
202. 0.000 0.000 ↓ 0.0 116,388 1

Merge Full Join (cost=0..0 rows=0 width=0) (actual rows=116,388 loops=1)

  • Merge Cond: ((p_12.id = preplanned_1.project_id) AND (pp_5.id = preplanned_1.projectpart_id) AND (pa_5.task_id = preplanned_1.activity_id))
203. 0.000 0.000 ↓ 0.0 84,612 1

GroupAggregate (cost=0..0 rows=0 width=0) (actual rows=84,612 loops=1)

  • Group Key: p_12.id, pp_5.id, pa_5.task_id, pa_5.finished
204. 0.000 0.000 ↓ 0.0 90,130 1

Sort (cost=0..0 rows=0 width=0) (actual rows=90,130 loops=1)

  • Sort Key: p_12.id, pp_5.id, pa_5.task_id, pa_5.finished
  • Sort Method: external merge Disk: 2,536kB
205. 0.000 0.000 ↓ 0.0 90,130 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=90,130 loops=1)

  • Hash Cond: (pp_5.project_id = p_12.id)
206. 0.000 0.000 ↓ 0.0 90,144 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=90,144 loops=1)

  • Hash Cond: (pa_5.projectpart_id = pp_5.id)
207. 0.000 0.000 ↓ 0.0 90,144 1

Seq Scan on projectactivity pa_5 (cost=0..0 rows=0 width=0) (actual rows=90,144 loops=1)

  • Filter: ((NOT preliminary) AND (NOT external) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 112,525
208. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,843kB
209. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_5 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
210. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 320kB
211. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_12 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

212. 0.000 0.000 ↓ 0.0 31,776 1

Sort (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

  • Sort Key: preplanned_1.project_id, preplanned_1.projectpart_id, preplanned_1.activity_id
  • Sort Method: quicksort Memory: 2,258kB
213. 0.000 0.000 ↓ 0.0 31,776 1

Subquery Scan on preplanned_1 (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

214. 0.000 0.000 ↓ 0.0 31,776 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=31,776 loops=1)

  • Group Key: p_13.id, pa_6.task_id
215. 0.000 0.000 ↓ 0.0 82,347 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=82,347 loops=1)

  • Hash Cond: (pp_6.project_id = p_13.id)
216. 0.000 0.000 ↓ 0.0 83,095 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=83,095 loops=1)

  • Hash Cond: (pa_6.projectpart_id = pp_6.id)
217. 0.000 0.000 ↓ 0.0 83,095 1

Seq Scan on projectactivity pa_6 (cost=0..0 rows=0 width=0) (actual rows=83,095 loops=1)

  • Filter: (preliminary AND (NOT external) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 119,574
218. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,843kB
219. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_6 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
220. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 286kB
221. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_13 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

222. 0.000 0.000 ↓ 0.0 84,366 1

Hash (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

  • Buckets: 32,768 Batches: 2 Memory Usage: 3,252kB
223. 0.000 0.000 ↓ 0.0 84,366 1

Subquery Scan on realdata_1 (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

224. 0.000 0.000 ↓ 0.0 84,366 1

GroupAggregate (cost=0..0 rows=0 width=0) (actual rows=84,366 loops=1)

  • Group Key: pac_1.project_id, (COALESCE(pac_1.projectpart_id, pp_7.id)), pac_1.activity_id
225. 0.000 0.000 ↓ 0.0 197,072 1

Sort (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Sort Key: pac_1.project_id, (COALESCE(pac_1.projectpart_id, pp_7.id)), pac_1.activity_id
  • Sort Method: external merge Disk: 9,592kB
226. 0.000 0.000 ↓ 0.0 197,072 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Hash Cond: (pa_7.projectpart_id = pp_7.id)
227. 0.000 0.000 ↓ 0.0 197,072 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Hash Cond: (pac_1.projectactivity_id = pa_7.id)
228. 0.000 0.000 ↓ 0.0 197,072 1

Seq Scan on projectactivityconfirmation pac_1 (cost=0..0 rows=0 width=0) (actual rows=197,072 loops=1)

  • Filter: (COALESCE((date <= (get_session_var('calcdate'::character varying))::date), true) AND COALESCE((date >= (get_session_var (...)
229. 0.000 0.000 ↓ 0.0 202,669 1

Hash (cost=0..0 rows=0 width=0) (actual rows=202,669 loops=1)

  • Buckets: 131,072 Batches: 4 Memory Usage: 3,018kB
230. 0.000 0.000 ↓ 0.0 202,669 1

Seq Scan on projectactivity pa_7 (cost=0..0 rows=0 width=0) (actual rows=202,669 loops=1)

231. 0.000 0.000 ↓ 0.0 72,175 1

Hash (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,562kB
232. 0.000 0.000 ↓ 0.0 72,175 1

Seq Scan on projectpart pp_7 (cost=0..0 rows=0 width=0) (actual rows=72,175 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 7,911
233. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 286kB
234. 0.000 0.000 ↓ 0.0 6,288 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Hash Cond: (p_11.id = subq_1.project_id)
235. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_11 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

236. 0.000 0.000 ↓ 0.0 6,099 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 279kB
237. 0.000 0.000 ↓ 0.0 6,099 1

Subquery Scan on subq_1 (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Filter: (subq_1.rank = 1)
  • Rows Removed by Filter: 13,330
238. 0.000 0.000 ↓ 0.0 19,429 1

WindowAgg (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

239. 0.000 0.000 ↓ 0.0 19,429 1

Sort (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

  • Sort Key: projectstatuschange_1.project_id, projectstatuschange_1.startdate DESC
  • Sort Method: quicksort Memory: 1,679kB
240. 0.000 0.000 ↓ 0.0 19,429 1

Seq Scan on projectstatuschange projectstatuschange_1 (cost=0..0 rows=0 width=0) (actual rows=19,429 loops=1)

  • Filter: ((recordstatus <> 'X'::recordstatus) AND COALESCE(((startdate)::date <= (get_session_var('calcdate'::character varying))::date (...)
  • Rows Removed by Filter: 26
241. 0.000 0.000 ↓ 0.0 79 1

Hash (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
242. 0.000 0.000 ↓ 0.0 79 1

Seq Scan on activity act_2 (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

243. 0.000 0.000 ↓ 0.0 1 1

Sort (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Sort Key: sb_2.projectpart_id
  • Sort Method: quicksort Memory: 968kB
244. 0.000 0.000 ↓ 0.0 12,455 1

Seq Scan on stockbooking sb_2 (cost=0..0 rows=0 width=0) (actual rows=12,455 loops=1)

245. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on ccosts_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

246. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_14.id, pc_7.projectpart_id, cu_6.id, cu_6.name, cu_6.number, (COALESCE(pc_7.tenant_id, p_14.tenant_id))
247. 0.000 0.000 ↓ 0.0 0 1

Append (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

248. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

249. 0.000 0.000 ↓ 0.0 0 1

Append (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

250. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_14.id, pc_7.projectpart_id, cu_6.id, cu_6.name, cu_6.number, COALESCE(pc_7.tenant_id, p_14.tenant_id), pc_7.orderdate
251. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_6.configuration_id = c_6.id)
252. 0.000 0.000 ↓ 0.0 1 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Join Filter: (p_14.tenant_id = t_6.id)
  • Rows Removed by Join Filter: 3
253. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Join Filter: (cu_6.id = p_14.costunit_id)
  • Rows Removed by Join Filter: 16
254. 0.000 0.000 ↓ 0.0 1 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Join Filter: (pc_7.project_id = p_14.id)
  • Filter: ((pc_7.projectpart_id IS NULL) AND COALESCE((pc_7.orderdate <= (get_session_var('calcdate'::character varying))::date), true) AND COALESCE((pc_7 (...)
255. 0.000 0.000 ↓ 0.0 1 1

Index Scan using project_pkey on project p_14 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1)

  • Index Cond: (id = 6,583)
256. 0.000 0.000 ↓ 0.0 0 1

Index Scan using idx_projectcomponent_project_id on projectcomponent pc_7 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Index Cond: (project_id = 6,583)
  • Filter: ((NOT preliminary) AND (recordstatus <> 'X'::recordstatus) AND (bookedquantity = '0'::double precision))
257. 0.000 0.000 ↓ 0.0 16 1

Seq Scan on costunit cu_6 (cost=0..0 rows=0 width=0) (actual rows=16 loops=1)

258. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on tenant t_6 (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

259. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on configuration c_6 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: ((NOT useinvoicesforprojectcalculation) AND (NOT onlyusebookedcomponentsforprojectcalculation))
  • Rows Removed by Filter: 4
260. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

261. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_15.id, cu_7.id, cu_7.name, cu_7.number, COALESCE(pc_8.tenant_id, p_15.tenant_id), pi_1.id, pii_2.positionnumber, pc_8.id
262. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

263. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (pois_2.id IS NULL)
  • Rows Removed by Join Filter: 3
  • Filter: ((pc_8.projectpart_id IS NULL) AND ((pc_8.* IS NULL) OR (pc_8.bookedquantity = '0'::double precision) OR (NOT c_7.ignorepurchaseinvoicesoncomponentswi (...)
  • Rows Removed by Filter: 11,802
264. 0.000 0.000 ↓ 0.0 11,802 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=11,802 loops=1)

  • Hash Cond: (COALESCE(pois_2.project_id, pii_2.project_id, pi_1.project_id) = p_15.id)
265. 0.000 0.000 ↓ 0.0 11,964 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual rows=11,964 loops=1)

  • Hash Cond: (pii_2.id = pois_2.purchaseinvoiceitem_id)
266. 0.000 0.000 ↓ 0.0 11,962 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=11,962 loops=1)

  • Hash Cond: (pii_2.purchaseinvoice_id = pi_1.id)
267. 0.000 0.000 ↓ 0.0 11,962 1

Seq Scan on purchaseinvoiceitem pii_2 (cost=0..0 rows=0 width=0) (actual rows=11,962 loops=1)

  • Filter: ((recordstatus <> 'X'::recordstatus) AND ((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[])) AND (((invoicetype)::text = ANY (...)
  • Rows Removed by Filter: 177
268. 0.000 0.000 ↓ 0.0 5,008 1

Hash (cost=0..0 rows=0 width=0) (actual rows=5,008 loops=1)

  • Buckets: 8,192 (originally 2048) Batches: 1 (originally 1) Memory Usage: 422kB
269. 0.000 0.000 ↓ 0.0 5,008 1

Seq Scan on purchaseinvoice pi_1 (cost=0..0 rows=0 width=0) (actual rows=5,008 loops=1)

  • Filter: (((status)::text = 'READY'::text) AND (date >= (COALESCE(get_session_var('startdate'::character varying), '1900-01-01':: (...)
  • Rows Removed by Filter: 144
270. 0.000 0.000 ↓ 0.0 3 1

Hash (cost=0..0 rows=0 width=0) (actual rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
271. 0.000 0.000 ↓ 0.0 6 1

Seq Scan on purchaseorderitemsplit pois_2 (cost=0..0 rows=0 width=0) (actual rows=6 loops=1)

272. 0.000 0.000 ↓ 0.0 6,288 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Buckets: 8,192 (originally 2048) Batches: 1 (originally 1) Memory Usage: 317kB
273. 0.000 0.000 ↓ 0.0 6,288 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

  • Hash Cond: (p_15.tenant_id = t_7.id)
274. 0.000 0.000 ↓ 0.0 6,288 1

Seq Scan on project p_15 (cost=0..0 rows=0 width=0) (actual rows=6,288 loops=1)

275. 0.000 0.000 ↓ 0.0 4 1

Hash (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
276. 0.000 0.000 ↓ 0.0 4 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Join Filter: (t_7.configuration_id = c_7.id)
  • Rows Removed by Join Filter: 12
277. 0.000 0.000 ↓ 0.0 4 1

Seq Scan on configuration c_7 (cost=0..0 rows=0 width=0) (actual rows=4 loops=1)

  • Filter: (useinvoicesforprojectcalculation AND (NOT onlyusebookedcomponentsforprojectcalculation))
278. 0.000 0.000 ↓ 0.0 4 4

Seq Scan on tenant t_7 (cost=0..0 rows=0 width=0) (actual rows=4 loops=4)

279. 0.000 0.000 ↓ 0.0 1 11,802

Index Scan using projectcomponent_pkey on projectcomponent pc_8 (cost=0..0 rows=0 width=0) (actual rows=1 loops=11,802)

  • Index Cond: (id = pii_2.projectcomponent_id)
  • Filter: ((NOT preliminary) AND (recordstatus <> 'X'::recordstatus))
  • Rows Removed by Filter: 0
280. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_costunit_displayname on costunit cu_7 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = p_15.costunit_id)
281. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

282. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: p_16.id, cu_8.id, cu_8.name, cu_8.number, COALESCE(pc_9.tenant_id, p_16.tenant_id), po_1.id, poi_2.positionnumber, pc_9.id
283. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (cu_8.id = p_16.costunit_id)
284. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (((pc_9.* IS NULL) OR (pc_9.bookedquantity = '0'::double precision) OR (NOT c_8.ignorepurchaseinvoicesoncomponentswithstockbookings)) AND (t_8.co (...)
285. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (p_16.tenant_id = t_8.id)
286. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (COALESCE(pc_9.project_id, p_16.id) = 6,583)
  • Rows Removed by Join Filter: 229
287. 0.000 0.000 ↓ 0.0 232 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=232 loops=1)

  • Join Filter: (pois_3.id IS NULL)
  • Filter: (pc_9.projectpart_id IS NULL)
  • Rows Removed by Filter: 160
288. 0.000 0.000 ↓ 0.0 392 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=392 loops=1)

  • Join Filter: (pois_3.purchaseorderitem_id = poi_2.id)
  • Rows Removed by Join Filter: 2,352
289. 0.000 0.000 ↓ 0.0 392 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=392 loops=1)

290. 0.000 0.000 ↓ 0.0 331 1

Seq Scan on purchaseorder po_1 (cost=0..0 rows=0 width=0) (actual rows=331 loops=1)

  • Filter: (((status)::text = 'READY'::text) AND (date >= (COALESCE(get_session_var('startdate'::character varying), '1900-01 (...)
  • Rows Removed by Filter: 6,633
291. 0.000 0.000 ↓ 0.0 1 331

Index Scan using idx_purchaseorderitem_purchaseorder_id on purchaseorderitem poi_2 (cost=0..0 rows=0 width=0) (actual rows=1 loops=331)

  • Index Cond: (purchaseorder_id = po_1.id)
  • Filter: ((recordstatus <> 'X'::recordstatus) AND ((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[])) AND (amountininvoic (...)
  • Rows Removed by Filter: 0
292. 0.000 0.000 ↓ 0.0 6 392

Materialize (cost=0..0 rows=0 width=0) (actual rows=6 loops=392)

293. 0.000 0.000 ↓ 0.0 6 1

Seq Scan on purchaseorderitemsplit pois_3 (cost=0..0 rows=0 width=0) (actual rows=6 loops=1)

294. 0.000 0.000 ↓ 0.0 1 392

Index Scan using projectcomponent_pkey on projectcomponent pc_9 (cost=0..0 rows=0 width=0) (actual rows=1 loops=392)

  • Index Cond: (id = poi_2.projectcomponent_id)
  • Filter: ((NOT preliminary) AND (recordstatus <> 'X'::recordstatus))
295. 0.000 0.000 ↓ 0.0 1 232

Index Scan using project_pkey on project p_16 (cost=0..0 rows=0 width=0) (actual rows=1 loops=232)

  • Index Cond: (id = COALESCE(pois_3.project_id, poi_2.project_id))
296. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t_8 (cost=0..0 rows=0 width=0) (never executed)

297. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuration c_8 (cost=0..0 rows=0 width=0) (never executed)

  • Filter: (useinvoicesforprojectcalculation AND useinvoicesorordersforprojectcalculation AND (NOT onlyusebookedcomponentsforprojectcalculation))
298. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu_8 (cost=0..0 rows=0 width=0) (never executed)

299. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

300. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: pc_10.id, cu_9.id, p_17.id, pa_8.id
301. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (CASE WHEN c_9.useinvoicesorordersforprojectcalculation THEN (poi_3.id IS NULL) ELSE true END AND (t_9.configuration_id = c_9.id))
302. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (p_17.tenant_id = t_9.id)
303. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

304. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (cu_9.id = p_17.costunit_id)
305. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

306. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: (pii_3.id IS NULL)
307. 0.000 0.000 ↓ 0.0 0 1

Hash Right Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Hash Cond: (poi_3.projectcomponent_id = pc_10.id)
308. 0.000 0.000 ↓ 0.0 0

Seq Scan on purchaseorderitem poi_3 (cost=0..0 rows=0 width=0) (never executed)

  • Filter: (((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[])) AND (recordstatus <> 'X'::recordstatus))
309. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
310. 0.000 0.000 ↓ 0.0 0 1

Index Scan using idx_projectcomponent_project_id on projectcomponent pc_10 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Index Cond: (project_id = 6,583)
  • Filter: ((NOT preliminary) AND (projectpart_id IS NULL) AND (recordstatus <> 'X'::recordstatus) AND (bookedquantity (...)
311. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_purchaseinvoiceitem_projectcomponent on purchaseinvoiceitem pii_3 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (pc_10.id = projectcomponent_id)
  • Filter: ((status)::text <> ALL ('{ENTRY,CANCELLED}'::text[]))
312. 0.000 0.000 ↓ 0.0 0

Index Scan using project_pkey on project p_17 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = 6,583)
313. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu_9 (cost=0..0 rows=0 width=0) (never executed)

314. 0.000 0.000 ↓ 0.0 0

Index Only Scan using projectactivity_pkey on projectactivity pa_8 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = pc_10.projectactivity_id)
  • Heap Fetches: 0
315. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t_9 (cost=0..0 rows=0 width=0) (never executed)

316. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuration c_9 (cost=0..0 rows=0 width=0) (never executed)

  • Filter: (useprojectcomponentswithoutinvoiceforcalculation AND useinvoicesforprojectcalculation AND (NOT onlyusebookedcomponentsforprojectcalculation))
317. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

318. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: pc_11.id, cu_10.id, p_18.id, pa_9.id
319. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

320. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (cu_10.id = p_18.costunit_id)
321. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: ((art_2.id IS NULL) OR (NOT art_2.storedinwarehouse))
322. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_10.configuration_id = c_10.id)
323. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (p_18.tenant_id = t_10.id)
324. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

325. 0.000 0.000 ↓ 0.0 0 1

Index Scan using idx_projectcomponent_project_id on projectcomponent pc_11 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Index Cond: (project_id = 6,583)
  • Filter: ((NOT preliminary) AND (projectpart_id IS NULL) AND (recordstatus <> 'X'::recordstatus) AND COALESCE((orderdate <= (get_ (...)
326. 0.000 0.000 ↓ 0.0 0

Index Scan using project_pkey on project p_18 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = 6,583)
327. 0.000 0.000 ↓ 0.0 0

Seq Scan on tenant t_10 (cost=0..0 rows=0 width=0) (never executed)

328. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuration c_10 (cost=0..0 rows=0 width=0) (never executed)

  • Filter: ((NOT useinvoicesforprojectcalculation) AND onlyusebookedcomponentsforprojectcalculation)
329. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_article_displayname on article art_2 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = pc_11.article_id)
330. 0.000 0.000 ↓ 0.0 0

Seq Scan on costunit cu_10 (cost=0..0 rows=0 width=0) (never executed)

331. 0.000 0.000 ↓ 0.0 0

Index Only Scan using projectactivity_pkey on projectactivity pa_9 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = pc_11.projectactivity_id)
  • Heap Fetches: 0
332. 0.000 0.000 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6_1 (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

333. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Group Key: COALESCE(p_19.id, pc_12.project_id), pc_12.id, cu_11.id, sb_3.tenant_id, sb_3.date
334. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

335. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Join Filter: (t_11.configuration_id = c_11.id)
336. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

337. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

338. 0.000 0.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=0 loops=1)

  • Filter: ((pc_12.projectpart_id IS NULL) AND (COALESCE(p_19.id, pc_12.project_id) = 6,583))
  • Rows Removed by Filter: 1,472
339. 0.000 0.000 ↓ 0.0 1,472 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

340. 0.000 0.000 ↓ 0.0 1,472 1

Hash Join (cost=0..0 rows=0 width=0) (actual rows=1,472 loops=1)

  • Hash Cond: (sb_3.project_id = p_19.id)
341. 0.000 0.000 ↓ 0.0 12,455 1

Seq Scan on stockbooking sb_3 (cost=0..0 rows=0 width=0) (actual rows=12,455 loops=1)

  • Filter: ((date >= (COALESCE(get_session_var('startdate'::character varying), '1900-01-01'::character varying))::date) AND (date <= (CO (...)
342. 0.000 0.000 ↓ 0.0 6,099 1

Hash (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 279kB
343. 0.000 0.000 ↓ 0.0 6,099 1

Seq Scan on project p_19 (cost=0..0 rows=0 width=0) (actual rows=6,099 loops=1)

  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 189
344. 0.000 0.000 ↓ 0.0 1 1,472

Index Scan using projectcomponent_pkey on projectcomponent pc_13 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1,472)

  • Index Cond: (id = sb_3.projectcomponent_id)
  • Filter: (recordstatus <> 'X'::recordstatus)
  • Rows Removed by Filter: 0
345. 0.000 0.000 ↓ 0.0 1 1,472

Index Scan using projectcomponent_pkey on projectcomponent pc_12 (cost=0..0 rows=0 width=0) (actual rows=1 loops=1,472)

  • Index Cond: (id = pc_13.id)
346. 0.000 0.000 ↓ 0.0 0

Index Scan using article_pkey on article art_3 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = pc_13.article_id)
347. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tenant_displayname on tenant t_11 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = sb_3.tenant_id)
348. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuration c_11 (cost=0..0 rows=0 width=0) (never executed)

349. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_costunit_displayname on costunit cu_11 (cost=0..0 rows=0 width=0) (never executed)

  • Index Cond: (id = sb_3.costunit_id)
350. 0.000 0.000 ↓ 0.0 0 3

Index Scan using projectpart_pkey on projectpart pp (cost=0..0 rows=0 width=0) (actual rows=0 loops=3)

  • Index Cond: (id = "*SELECT* 1".projectpart_id)
351. 0.000 0.000 ↓ 0.0 79 1

Hash (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
352. 0.000 0.000 ↓ 0.0 79 1

Seq Scan on activity act (cost=0..0 rows=0 width=0) (actual rows=79 loops=1)

353. 0.000 0.000 ↓ 0.0 14 1

Hash (cost=0..0 rows=0 width=0) (actual rows=14 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
354. 0.000 0.000 ↓ 0.0 14 1

Seq Scan on projectgroup pg (cost=0..0 rows=0 width=0) (actual rows=14 loops=1)

355. 0.000 0.000 ↓ 0.0 0 3

Index Only Scan using idx_unit_displayname on unit (cost=0..0 rows=0 width=0) (actual rows=0 loops=3)

  • Index Cond: (id = pp.unit_id)
  • Heap Fetches: 1
Planning time : 99.366 ms
Execution time : 4,573.605 ms