0 Nested Loop (cost=1′ 837′ 055.17 ..1′ 837′ 064.35 rows=1 width=213 )
1 -> Limit (cost=1′ 837′ 054.74 ..1′ 837′ 055.90 rows=1 width=16 )
2
3 -> Aggregate (cost=1.06 ..1.07 rows=1 width=8 )
4 -> Seq Scan on "SearchAttributes" s (cost=0.00 ..1.06 rows=1 width=0 )
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed' ::uuid)
5 -> Finalize GroupAggregate (cost=1′ 837′ 053.66 ..1′ 837′ 054.82 rows=1 width=16 )
Group Key: d."BaseObjectId"
Filter: (count(1 ) = $0 )
6 -> Gather Merge (cost=1′ 837′ 053.66 ..1′ 837′ 054.66 rows=8 width=24 )
Workers Planned: 2
7 -> Partial GroupAggregate (cost=1′ 836′ 053.64 ..1′ 836′ 053.71 rows=4 width=24 )
Group Key: d."BaseObjectId"
8 -> Sort (cost=1′ 836′ 053.64 ..1′ 836′ 053.65 rows=4 width=16 )
Sort Key: d."BaseObjectId"
9 -> Nested Loop (cost=393′ 506.99 ..1′ 836′ 053.60 rows=4 width=16 )
10 -> Merge Join (cost=393′ 506.42 ..411′ 647.67 rows=2′ 875 width=16 )
Merge Cond: ((d."Uid" = a.u) AND (d."Version" = a.v))
11 -> Sort (cost=110′ 167.96 ..111′ 605.46 rows=575′ 000 width=36 )
Sort Key: d."Uid", d."Version"
12 -> Parallel Seq Scan on "Documents" d (cost=0.00 ..39′ 434.50 rows=575′ 000 width=36 )
Filter: ("OrgUnidUid" = '70d14fac-b3e6-401f-9f55-40dbe636b8fe' ::uuid)
13 -> Materialize (cost=283′ 338.46 ..290′ 238.46 rows=1′ 380′ 000 width=20 )
14 -> Sort (cost=283′ 338.46 ..286′ 788.46 rows=1′ 380′ 000 width=20 )
Sort Key: a.u, a.v
15 -> Subquery Scan on a (cost=0.43 ..86′ 002.43 rows=1′ 380′ 000 width=20 )
16 -> GroupAggregate (cost=0.43 ..72′ 202.43 rows=1′ 380′ 000 width=24 )
Group Key: "Documents"."Uid", "Documents"."Version"
17 -> Index Only Scan using "PK_Documents" on "Documents" (cost=0.43 ..48′ 052.43 rows=1′ 380′ 000 width=20 )
18 -> Nested Loop (cost=0.57 ..495.44 rows=1 width=16 )
Join Filter: (av."Value" @> sa."Value")
19 -> Nested Loop (cost=0.00 ..11.69 rows=3 width=92 )
Join Filter: (att."Name" = sa."AttributeName")
20 -> Seq Scan on "SearchAttributes" sa (cost=0.00 ..1.06 rows=1 width=97 )
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed' ::uuid)
21 -> Seq Scan on "Attributes" att (cost=0.00 ..7.50 rows=250 width=17 )
22 -> Index Scan using "PK_AttributeValues" on "AttributeValues" av (cost=0.57 ..160.76 rows=39 width=118 )
Index Cond: (("BaseObjectId" = d."BaseObjectId") AND ("AttributeId" = att."AttributeId"))
23 -> Index Scan using "IX_Documents_BaseObjectId" on "Documents" docs (cost=0.43 ..8.45 rows=1 width=213 )
Index Cond: ("BaseObjectId" = d."BaseObjectId")
"PK_Documents" "Documents" "PK_Documents" "Documents" GroupAggregate GroupAggregate a a a "Documents" d "Documents" d Sort Sort "SearchAttributes" sa "SearchAttributes" sa "Attributes" att "Attributes" att Sort Sort Materialize Materialize Nested Loop Nested Loop "PK_AttributeValues" "AttributeValues" av "PK_AttributeValues" "AttributeValues" av Merge Join Merge Join Nested Loop Nested Loop Nested Loop Nested Loop Sort Sort "SearchAttributes" s "SearchAttributes" s Partial GroupAggregate Partial GroupAggregate Aggregate Aggregate $0 Gather Merge Gather Merge Finalize GroupAggregate Finalize GroupAggregate Limit Limit "IX_Documents_BaseObjectId" "Documents" docs "IX_Documents_BaseObjectId" "Documents" docs Nested Loop Nested Loop
Nested Loop (cost=1′ 837′ 055.17 ..1′ 837′ 064.35 rows=1 width=213 )
-> Limit (cost=1′ 837′ 054.74 ..1′ 837′ 055.90 rows=1 width=16 )
InitPlan 1 (returns $0)
-> Aggregate (cost=1.06 ..1.07 rows=1 width=8 )
-> Seq Scan on "SearchAttributes" s (cost=0.00 ..1.06 rows=1 width=0 )
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed' ::uuid)
-> Finalize GroupAggregate (cost=1′ 837′ 053.66 ..1′ 837′ 054.82 rows=1 width=16 )
Group Key: d."BaseObjectId"
Filter: (count(1 ) = $0 )
-> Gather Merge (cost=1′ 837′ 053.66 ..1′ 837′ 054.66 rows=8 width=24 )
Workers Planned: 2
-> Partial GroupAggregate (cost=1′ 836′ 053.64 ..1′ 836′ 053.71 rows=4 width=24 )
Group Key: d."BaseObjectId"
-> Sort (cost=1′ 836′ 053.64 ..1′ 836′ 053.65 rows=4 width=16 )
Sort Key: d."BaseObjectId"
-> Nested Loop (cost=393′ 506.99 ..1′ 836′ 053.60 rows=4 width=16 )
-> Merge Join (cost=393′ 506.42 ..411′ 647.67 rows=2′ 875 width=16 )
Merge Cond: ((d."Uid" = a.u) AND (d."Version" = a.v))
-> Sort (cost=110′ 167.96 ..111′ 605.46 rows=575′ 000 width=36 )
Sort Key: d."Uid", d."Version"
-> Parallel Seq Scan on "Documents" d (cost=0.00 ..39′ 434.50 rows=575′ 000 width=36 )
Filter: ("OrgUnidUid" = '70d14fac-b3e6-401f-9f55-40dbe636b8fe' ::uuid)
-> Materialize (cost=283′ 338.46 ..290′ 238.46 rows=1′ 380′ 000 width=20 )
-> Sort (cost=283′ 338.46 ..286′ 788.46 rows=1′ 380′ 000 width=20 )
Sort Key: a.u, a.v
-> Subquery Scan on a (cost=0.43 ..86′ 002.43 rows=1′ 380′ 000 width=20 )
-> GroupAggregate (cost=0.43 ..72′ 202.43 rows=1′ 380′ 000 width=24 )
Group Key: "Documents"."Uid", "Documents"."Version"
-> Index Only Scan using "PK_Documents" on "Documents" (cost=0.43 ..48′ 052.43 rows=1′ 380′ 000 width=20 )
-> Nested Loop (cost=0.57 ..495.44 rows=1 width=16 )
Join Filter: (av."Value" @> sa."Value")
-> Nested Loop (cost=0.00 ..11.69 rows=3 width=92 )
Join Filter: (att."Name" = sa."AttributeName")
-> Seq Scan on "SearchAttributes" sa (cost=0.00 ..1.06 rows=1 width=97 )
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed' ::uuid)
-> Seq Scan on "Attributes" att (cost=0.00 ..7.50 rows=250 width=17 )
-> Index Scan using "PK_AttributeValues" on "AttributeValues" av (cost=0.57 ..160.76 rows=39 width=118 )
Index Cond: (("BaseObjectId" = d."BaseObjectId") AND ("AttributeId" = att."AttributeId"))
-> Index Scan using "IX_Documents_BaseObjectId" on "Documents" docs (cost=0.43 ..8.45 rows=1 width=213 )
Index Cond: ("BaseObjectId" = d."BaseObjectId")
Join
-> Limit
InitPlan 1
-> Process
-> Scan Table "SearchAttributes"
-> Join
-> Scan Subquery
-> Process
-> Scan Table "Documents"
-> Scan Table "AttributeValues"
-> Scan Table "Attributes"
-> Scan Table "Documents"
-> Scan Table "SearchAttributes"
-> Scan Table "Documents"
Nested Loop (cost=1837055.17..1837064.35 rows=1 width=213)
-> Limit (cost=1837054.74..1837055.90 rows=1 width=16)
InitPlan 1 (returns $0)
-> Aggregate (cost=1.06..1.07 rows=1 width=8)
-> Seq Scan on "SearchAttributes" s (cost=0.00..1.06 rows=1 width=0)
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed'::uuid)
-> Finalize GroupAggregate (cost=1837053.66..1837054.82 rows=1 width=16)
Group Key: d."BaseObjectId"
Filter: (count(1) = $0)
-> Gather Merge (cost=1837053.66..1837054.66 rows=8 width=24)
Workers Planned: 2
-> Partial GroupAggregate (cost=1836053.64..1836053.71 rows=4 width=24)
Group Key: d."BaseObjectId"
-> Sort (cost=1836053.64..1836053.65 rows=4 width=16)
Sort Key: d."BaseObjectId"
-> Nested Loop (cost=393506.99..1836053.60 rows=4 width=16)
-> Merge Join (cost=393506.42..411647.67 rows=2875 width=16)
Merge Cond: ((d."Uid" = a.u) AND (d."Version" = a.v))
-> Sort (cost=110167.96..111605.46 rows=575000 width=36)
Sort Key: d."Uid", d."Version"
-> Parallel Seq Scan on "Documents" d (cost=0.00..39434.50 rows=575000 width=36)
Filter: ("OrgUnidUid" = '70d14fac-b3e6-401f-9f55-40dbe636b8fe'::uuid)
-> Materialize (cost=283338.46..290238.46 rows=1380000 width=20)
-> Sort (cost=283338.46..286788.46 rows=1380000 width=20)
Sort Key: a.u, a.v
-> Subquery Scan on a (cost=0.43..86002.43 rows=1380000 width=20)
-> GroupAggregate (cost=0.43..72202.43 rows=1380000 width=24)
Group Key: "Documents"."Uid", "Documents"."Version"
-> Index Only Scan using "PK_Documents" on "Documents" (cost=0.43..48052.43 rows=1380000 width=20)
-> Nested Loop (cost=0.57..495.44 rows=1 width=16)
Join Filter: (av."Value" @> sa."Value")
-> Nested Loop (cost=0.00..11.69 rows=3 width=92)
Join Filter: (att."Name" = sa."AttributeName")
-> Seq Scan on "SearchAttributes" sa (cost=0.00..1.06 rows=1 width=97)
Filter: ("UserId" = '62c4e5c3-a32d-44e1-8b77-f1eb3dd82aed'::uuid)
-> Seq Scan on "Attributes" att (cost=0.00..7.50 rows=250 width=17)
-> Index Scan using "PK_AttributeValues" on "AttributeValues" av (cost=0.57..160.76 rows=39 width=118)
Index Cond: (("BaseObjectId" = d."BaseObjectId") AND ("AttributeId" = att."AttributeId"))
-> Index Scan using "IX_Documents_BaseObjectId" on "Documents" docs (cost=0.43..8.45 rows=1 width=213)
Index Cond: ("BaseObjectId" = d."BaseObjectId")