2025-02-07 16:23:30.681
cb583b71-94b0-2bff-cdbe-c3c59b729022
 0.816 ms
#
node
итоговые результаты
0
Nested Loop
1
  ->  Limit
2
       InitPlan 1 (returns $0)
3
        ->  Aggregate
4
             ->  Seq Scan on "SearchAttributes" s
5
       ->  Finalize GroupAggregate
6
            ->  Gather Merge
7
                 ->  Partial GroupAggregate
8
                      ->  Sort
9
                           ->  Nested Loop
10
                                ->  Merge Join
11
                                     ->  Sort
12
                                          ->  Parallel Seq Scan on "Documents" d
13
                                     ->  Materialize
14
                                          ->  Sort
15
                                               ->  Subquery Scan on a
16
                                                    ->  GroupAggregate
17
                                                         ->  Index Only Scan using "PK_Documents" on "Documents"
18
                                ->  Nested Loop
19
                                     ->  Nested Loop
20
                                          ->  Seq Scan on "SearchAttributes" sa
21
                                          ->  Seq Scan on "Attributes" att
22
                                     ->  Index Scan using "PK_AttributeValues" on "AttributeValues" av
23
  ->  Index Scan using "IX_Documents_BaseObjectId" on "Documents" docs
"PK_Documents""Documents""PK_Documents""Documents"GroupAggregateGroupAggregateaaa"Documents" d"Documents" dSortSort"SearchAttributes" sa"SearchAttributes" sa"Attributes" att"Attributes" attSortSortMaterializeMaterializeNested LoopNested Loop"PK_AttributeValues""AttributeValues" av"PK_AttributeValues""AttributeValues" avMerge JoinMerge JoinNested LoopNested LoopNested LoopNested LoopSortSort"SearchAttributes" s"SearchAttributes" sPartial GroupAggregatePartial GroupAggregateAggregateAggregate$0Gather MergeGather MergeFinalize GroupAggregateFinalize GroupAggregateLimitLimit"IX_Documents_BaseObjectId""Documents" docs"IX_Documents_BaseObjectId""Documents" docsNested LoopNested Loop
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")
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")
tooltip