2025-03-15 18:56:07.907
787fe39e71ec68a7709aaae6b4275c92
 1.149 ms
HR#7
RR#13
CC#16
RR#18
CC#20
RR#22
HF#28
CC#29
CC#44
HF#47
CC#52
CC#56
#13 IS |
#44 A |
tilemap |  piechart
timetilemap
#
node, ms
tree, ms
rows
RRbF
loops
132370.9492015589
итоговые результаты (3.5KB = rows=20 x width=178)
0
1638.000
132370.949
20
Hash Right Join
1
4833.980
124690.883
83751
  ->  Nested Loop
2
3930.359
101012.928
83751
       ->  Nested Loop
3
4442.113
74218.546
83751
            ->  Nested Loop
4
4044.748
57213.783
83751
                 ->  Nested Loop
5
4391.266
38596.361
83751
                      ->  Nested Loop
6
6997.460
13434.847
83751
                           ->  Hash Join
7
6437.157
474843
HR
                                ->  Seq Scan on object_reference rw
8
.074
.230
3
                                ->  Hash
9
.156
3
89
96.7%
                                     ->  Seq Scan on object_type tw
10
4773.807
20770.248
83751
83751
                           ->  Subquery Scan on vv0
11
4187.550
15996.441
83751
83751
                                ->  Aggregate
12
3399.114
11808.891
83751
                                     ->  Nested Loop
13
7286.337
83751
RR
                                          ->  Index Scan using object_reference_ndx2 on attrib_value av
14
1123.440
28086
28086
                                          ->  Index Scan using value_string_pkey on value_string sv
15
4606.305
14572.674
83751
83751
                      ->  Subquery Scan on vv1
16
3433.791
9966.369
83751
83751
CC
                           ->  Aggregate
17
2929.782
6532.578
83751
                                ->  Nested Loop
18
3098.787
83751
RR
                                     ->  Index Scan using object_reference_ndx2 on attrib_value av_1
19
504.009
18667
18667
                                     ->  Index Scan using value_string_pkey on value_string sv_1
20
3852.546
12562.650
83751
83751
CC
                 ->  Aggregate
21
3270.434
8710.104
83751
                      ->  Nested Loop
22
3517.542
83751
RR
                           ->  Index Scan using object_reference_ndx2 on attrib_value av_2
23
1922.128
18482
18482
                           ->  Index Scan using value_string_pkey on value_string sv_2
24
4103.799
22864.023
83751
83751
            ->  Subquery Scan on vv4
25
4690.056
18760.224
83751
83751
                 ->  Aggregate
26
5136.258
14070.168
83751
83751
                      ->  Nested Loop
27
5108.811
83751
83751
                           ->  Index Scan using object_reference_ndx2 on attrib_value av_3
28
3825.099
67107
67107
HF
                           ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv
29
4522.554
18843.975
83751
83751
CC
       ->  Aggregate
30
6867.582
14321.421
83751
83751
            ->  Nested Loop
31
5025.060
83751
83751
                 ->  Index Scan using object_reference_ndx2 on attrib_value av_4
32
2428.779
83751
83751
                 ->  Index Scan using value_string_pkey on value_string sv_3
33
.320
6042.066
20
  ->  Hash
34
.726
6041.746
20
       ->  Unique
35
1.089
6041.020
57
            ->  Sort
36
2.107
6039.931
57
                 ->  Nested Loop
37
2.275
6027.279
57
                      ->  Nested Loop
38
2.250
5968.482
59
                           ->  Nested Loop
39
625.911
5956.202
59
                                ->  Nested Loop
40
470.543
938.726
15409
                                     ->  Nested Loop
41
.187
1
91
98.9%
                                          ->  Seq Scan on object_type tw_1
42
462.833
467.996
15409
                                          ->  Bitmap Heap Scan on object_reference rw_1
43
5.163
15409
                                               ->  Bitmap Index Scan on "ric-object_reference-ccd76827"
44
493.088
4391.565
15409
100.0%
15409
CC
                                     ->  Aggregate
45
1153.561
3898.477
15409
15409
                                          ->  Nested Loop
46
2064.806
15409
15409
                                               ->  Index Scan using object_reference_ndx2 on attrib_value av_5
47
680.110
14785
14785
HF
                                               ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1
48
2.301
10.030
59
59
                                ->  Aggregate
49
3.540
7.729
59
59
                                     ->  Nested Loop
50
2.832
59
59
                                          ->  Index Scan using object_reference_ndx2 on attrib_value av_6
51
1.357
59
59
                                          ->  Index Scan using value_numeric_pkey on value_numeric nv
52
2.360
56.522
59
0.0%
59
CC
                           ->  Aggregate
53
3.009
54.162
59
59
                                ->  Nested Loop
54
49.737
59
59
                                     ->  Index Scan using object_reference_ndx2 on attrib_value av_7
55
1.416
59
59
                                     ->  Index Scan using value_numeric_pkey on value_numeric nv_1
56
2.166
10.545
57
57
CC
                      ->  Aggregate
57
2.907
8.379
57
57
                           ->  Nested Loop
58
2.109
57
57
                                ->  Index Scan using object_reference_ndx2 on attrib_value av_8
59
3.363
57
57
                                ->  Index Scan using value_numeric_pkey on value_numeric nv_2
18.793
 
Planning Time
2.300
132373.249
Execution Time
100% | в размер"ric-object_reference-ccd76827""ric-object_reference-ccd76827"object_reference_ndx2attrib_value av_5object_reference_ndx2attrib_value av_515409"ric-value_datetime-09d9596e"value_datetime dv_1"ric-value_datetime-09d9596e"value_datetime dv_114785object_reference_ndx2attrib_value avobject_reference_ndx2attrib_value av83751value_string_pkeyvalue_string svvalue_string_pkeyvalue_string sv28086object_type tw_1object_type tw_1object_reference rw_1object_reference rw_1Nested LoopNested Loop15409object_reference_ndx2attrib_value av_6object_reference_ndx2attrib_value av_659value_numeric_pkeyvalue_numeric nvvalue_numeric_pkeyvalue_numeric nv59object_type twobject_type twNested LoopNested Loop83751object_reference_ndx2attrib_value av_1object_reference_ndx2attrib_value av_183751value_string_pkeyvalue_string sv_1value_string_pkeyvalue_string sv_118667Nested LoopNested LoopAggregateAggregate15409Nested LoopNested Loop59object_reference_ndx2attrib_value av_7object_reference_ndx2attrib_value av_759value_numeric_pkeyvalue_numeric nv_1value_numeric_pkeyvalue_numeric nv_159object_reference rwobject_reference rwHashHashAggregateAggregate83751vv0Nested LoopNested Loop83751Nested LoopNested LoopAggregateAggregate59Nested LoopNested Loop59object_reference_ndx2attrib_value av_8object_reference_ndx2attrib_value av_857value_numeric_pkeyvalue_numeric nv_2value_numeric_pkeyvalue_numeric nv_257Hash JoinHash Joinvv0vv083751AggregateAggregate83751vv1object_reference_ndx2attrib_value av_2object_reference_ndx2attrib_value av_283751value_string_pkeyvalue_string sv_2value_string_pkeyvalue_string sv_218482object_reference_ndx2attrib_value av_3object_reference_ndx2attrib_value av_383751"ric-value_datetime-09d9596e"value_datetime dv"ric-value_datetime-09d9596e"value_datetime dv67107Nested LoopNested LoopAggregateAggregate59Nested LoopNested Loop57Nested LoopNested Loopvv1vv183751Nested LoopNested Loop83751Nested LoopNested Loop83751Nested LoopNested LoopAggregateAggregate57Nested LoopNested LoopAggregateAggregate83751AggregateAggregate83751vv4object_reference_ndx2attrib_value av_4object_reference_ndx2attrib_value av_483751value_string_pkeyvalue_string sv_3value_string_pkeyvalue_string sv_383751Nested LoopNested LoopNested LoopNested Loopvv4vv483751Nested LoopNested Loop83751SortSortNested LoopNested LoopAggregateAggregate83751UniqueUniqueNested LoopNested LoopHashHashHash Right JoinHash Right Join
Hash Right Join  (cost=752401.02..2802844.68 rows=77 width=178) (actual time=14335.933..132370.949 rows=20 loops=1)
  Hash Cond: ((rw.id)::double precision = (max(nv_2.value)))
  ->  Nested Loop  (cost=134.70..2050534.84 rows=15484 width=178) (actual time=1.908..124690.883 rows=83751 loops=1)
        ->  Nested Loop  (cost=96.17..1453703.22 rows=15484 width=146) (actual time=1.649..101012.928 rows=83751 loops=1)
              ->  Nested Loop  (cost=57.65..856716.77 rows=15484 width=138) (actual time=1.311..74218.546 rows=83751 loops=1)
                    ->  Nested Loop  (cost=39.53..575914.18 rows=15484 width=106) (actual time=1.148..57213.783 rows=83751 loops=1)
                          ->  Nested Loop  (cost=21.42..294918.04 rows=15484 width=74) (actual time=0.937..38596.361 rows=83751 loops=1)
                                ->  Hash Join  (cost=3.30..13960.61 rows=15484 width=42) (actual time=0.513..13434.847 rows=83751 loops=1)
                                      Hash Cond: (rw.type_id = tw.id)
                                      ->  Seq Scan on object_reference rw  (cost=0.00..12653.43 rows=474843 width=51) (actual time=0.083..6437.157 rows=474843 loops=1)
                                      ->  Hash  (cost=3.26..3.26 rows=3 width=9) (actual time=0.202..0.230 rows=3 loops=1)
                                            Buckets: 1024  Batches: 1  Memory Usage: 9kB
                                            ->  Seq Scan on object_type tw  (cost=0.00..3.26 rows=3 width=9) (actual time=0.099..0.156 rows=3 loops=1)
                                                  Filter: ((mnemo)::text = ANY ('{Dvl,Clt,Cnt}'::text[]))
                                                  Rows Removed by Filter: 89
                                ->  Subquery Scan on vv0  (cost=18.12..18.14 rows=1 width=32) (actual time=0.203..0.248 rows=1 loops=83751)
                                      ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.177..0.191 rows=1 loops=83751)
                                            ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.124..0.141 rows=0 loops=83751)
                                                  ->  Index Scan using object_reference_ndx2 on attrib_value av  (cost=0.56..9.67 rows=1 width=10) (actual time=0.081..0.087 rows=0 loops=83751)
                                                        Index Cond: ((object_id = rw.id) AND (attrib_id = '100000016000000'::numeric))
                                                  ->  Index Scan using value_string_pkey on value_string sv  (cost=0.42..8.44 rows=1 width=142) (actual time=0.040..0.040 rows=1 loops=28086)
                                                        Index Cond: (id = av.value_id)
                          ->  Subquery Scan on vv1  (cost=18.12..18.14 rows=1 width=32) (actual time=0.137..0.174 rows=1 loops=83751)
                                ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.106..0.119 rows=1 loops=83751)
                                      ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.068..0.078 rows=0 loops=83751)
                                            ->  Index Scan using object_reference_ndx2 on attrib_value av_1  (cost=0.56..9.67 rows=1 width=10) (actual time=0.032..0.037 rows=0 loops=83751)
                                                  Index Cond: ((object_id = rw.id) AND (attrib_id = '3000000000002'::numeric))
                                            ->  Index Scan using value_string_pkey on value_string sv_1  (cost=0.42..8.44 rows=1 width=142) (actual time=0.027..0.027 rows=1 loops=18667)
                                                  Index Cond: (id = av_1.value_id)
                    ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.136..0.150 rows=1 loops=83751)
                          ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.096..0.104 rows=0 loops=83751)
                                ->  Index Scan using object_reference_ndx2 on attrib_value av_2  (cost=0.56..9.67 rows=1 width=10) (actual time=0.039..0.042 rows=0 loops=83751)
                                      Index Cond: ((object_id = rw.id) AND (attrib_id = '100004974000000'::numeric))
                                ->  Index Scan using value_string_pkey on value_string sv_2  (cost=0.42..8.44 rows=1 width=142) (actual time=0.104..0.104 rows=1 loops=18482)
                                      Index Cond: (id = av_2.value_id)
              ->  Subquery Scan on vv4  (cost=38.53..38.55 rows=1 width=8) (actual time=0.236..0.273 rows=1 loops=83751)
                    ->  Aggregate  (cost=38.53..38.54 rows=1 width=8) (actual time=0.210..0.224 rows=1 loops=83751)
                          ->  Nested Loop  (cost=0.99..38.52 rows=3 width=8) (actual time=0.137..0.168 rows=1 loops=83751)
                                ->  Index Scan using object_reference_ndx2 on attrib_value av_3  (cost=0.56..13.19 rows=3 width=10) (actual time=0.048..0.061 rows=1 loops=83751)
                                      Index Cond: ((object_id = rw.id) AND (attrib_id = '8'::numeric))
                                ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv  (cost=0.42..8.44 rows=1 width=18) (actual time=0.057..0.057 rows=1 loops=67107)
                                      Index Cond: (id = av_3.value_id)
                                      Heap Fetches: 67107
        ->  Aggregate  (cost=38.53..38.54 rows=1 width=32) (actual time=0.212..0.225 rows=1 loops=83751)
              ->  Nested Loop  (cost=0.99..38.52 rows=3 width=132) (actual time=0.131..0.171 rows=1 loops=83751)
                    ->  Index Scan using object_reference_ndx2 on attrib_value av_4  (cost=0.56..13.19 rows=3 width=10) (actual time=0.047..0.060 rows=1 loops=83751)
                          Index Cond: ((object_id = rw.id) AND (attrib_id = '3000000000122'::numeric))
                    ->  Index Scan using value_string_pkey on value_string sv_3  (cost=0.42..8.44 rows=1 width=142) (actual time=0.029..0.029 rows=1 loops=83751)
                          Index Cond: (id = av_4.value_id)
  ->  Hash  (cost=752266.31..752266.31 rows=1 width=8) (actual time=6041.422..6042.066 rows=20 loops=1)
        Buckets: 1024  Batches: 1  Memory Usage: 9kB
        ->  Unique  (cost=752240.51..752266.31 rows=1 width=8) (actual time=6039.994..6041.746 rows=20 loops=1)
              ->  Sort  (cost=752240.51..752253.41 rows=5161 width=8) (actual time=6039.967..6041.020 rows=57 loops=1)
                    Sort Key: (max(nv_2.value))
                    Sort Method: quicksort  Memory: 25kB
                    ->  Nested Loop  (cost=342.03..751922.24 rows=5161 width=8) (actual time=3555.909..6039.931 rows=57 loops=1)
                          ->  Nested Loop  (cost=313.71..605659.28 rows=5161 width=10) (actual time=3555.476..6027.279 rows=57 loops=1)
                                ->  Nested Loop  (cost=264.98..353982.70 rows=5161 width=10) (actual time=3555.036..5968.482 rows=59 loops=1)
                                      ->  Nested Loop  (cost=216.25..102306.11 rows=5161 width=10) (actual time=3554.509..5956.202 rows=59 loops=1)
                                            ->  Nested Loop  (cost=198.13..8633.88 rows=5161 width=10) (actual time=7.242..938.726 rows=15409 loops=1)
                                                  ->  Seq Scan on object_type tw_1  (cost=0.00..3.15 rows=1 width=9) (actual time=0.123..0.187 rows=1 loops=1)
                                                        Filter: ((mnemo)::text = 'Lst'::text)
                                                        Rows Removed by Filter: 91
                                                  ->  Bitmap Heap Scan on object_reference rw_1  (cost=198.13..8545.94 rows=8479 width=19) (actual time=7.033..467.996 rows=15409 loops=1)
                                                        Recheck Cond: (type_id = tw_1.id)
                                                        Heap Blocks: exact=5230
                                                        ->  Bitmap Index Scan on "ric-object_reference-ccd76827"  (cost=0.00..196.02 rows=8479 width=0) (actual time=5.145..5.163 rows=15409 loops=1)
                                                              Index Cond: (type_id = tw_1.id)
                                            ->  Aggregate  (cost=18.12..18.13 rows=1 width=8) (actual time=0.285..0.285 rows=0 loops=15409)
                                                  Filter: ((max(dv_1.value) >= '2023-09-01 00:00:00'::timestamp without time zone) AND (max(dv_1.value) <= '2024-01-01 00:00:00'::timestamp without time zone))
                                                  Rows Removed by Filter: 1
                                                  ->  Nested Loop  (cost=0.99..18.11 rows=1 width=8) (actual time=0.213..0.253 rows=1 loops=15409)
                                                        ->  Index Scan using object_reference_ndx2 on attrib_value av_5  (cost=0.56..9.67 rows=1 width=10) (actual time=0.121..0.134 rows=1 loops=15409)
                                                              Index Cond: ((object_id = rw_1.id) AND (attrib_id = '3000000000082'::numeric))
                                                        ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1  (cost=0.42..8.44 rows=1 width=18) (actual time=0.046..0.046 rows=1 loops=14785)
                                                              Index Cond: (id = av_5.value_id)
                                                              Heap Fetches: 14785
                                      ->  Aggregate  (cost=48.73..48.75 rows=1 width=8) (actual time=0.160..0.170 rows=1 loops=59)
                                            Filter: (abs(max(nv.value)) = '50'::double precision)
                                            ->  Nested Loop  (cost=0.99..48.72 rows=4 width=8) (actual time=0.093..0.131 rows=1 loops=59)
                                                  ->  Index Scan using object_reference_ndx2 on attrib_value av_6  (cost=0.56..14.95 rows=4 width=10) (actual time=0.036..0.048 rows=1 loops=59)
                                                        Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100000019000005'::numeric))
                                                  ->  Index Scan using value_numeric_pkey on value_numeric nv  (cost=0.42..8.44 rows=1 width=18) (actual time=0.023..0.023 rows=1 loops=59)
                                                        Index Cond: (id = av_6.value_id)
                                ->  Aggregate  (cost=48.73..48.75 rows=1 width=8) (actual time=0.948..0.958 rows=1 loops=59)
                                      Filter: (abs(max(nv_1.value)) >= '28673'::double precision)
                                      Rows Removed by Filter: 0
                                      ->  Nested Loop  (cost=0.99..48.72 rows=4 width=8) (actual time=0.890..0.918 rows=1 loops=59)
                                            ->  Index Scan using object_reference_ndx2 on attrib_value av_7  (cost=0.56..14.95 rows=4 width=10) (actual time=0.833..0.843 rows=1 loops=59)
                                                  Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100004060500000'::numeric))
                                            ->  Index Scan using value_numeric_pkey on value_numeric nv_1  (cost=0.42..8.44 rows=1 width=18) (actual time=0.023..0.024 rows=1 loops=59)
                                                  Index Cond: (id = av_7.value_id)
                          ->  Aggregate  (cost=28.32..28.33 rows=1 width=8) (actual time=0.176..0.185 rows=1 loops=57)
                                ->  Nested Loop  (cost=0.99..28.32 rows=2 width=8) (actual time=0.120..0.147 rows=1 loops=57)
                                      ->  Index Scan using object_reference_ndx2 on attrib_value av_8  (cost=0.56..11.43 rows=2 width=10) (actual time=0.027..0.037 rows=1 loops=57)
                                            Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100004060300000'::numeric))
                                      ->  Index Scan using value_numeric_pkey on value_numeric nv_2  (cost=0.42..8.44 rows=1 width=18) (actual time=0.058..0.059 rows=1 loops=57)
                                            Index Cond: (id = av_8.value_id)
Planning Time: 18.793 ms
Execution Time: 132373.249 ms
Join
  ->  Scan Subquery
        ->  Process
              ->  Join
                    ->  Scan Table attrib_value
                    ->  Scan Table value_string
  ->  Scan Subquery
        ->  Process
              ->  Join
                    ->  Scan Table attrib_value
                    ->  Scan Table value_string
  ->  Scan Subquery
        ->  Process
              ->  Join
                    ->  Scan Table attrib_value
                    ->  Scan Table value_datetime
  ->  Scan Table attrib_value
  ->  Scan Table attrib_value
  ->  Scan Table attrib_value
  ->  Scan Table attrib_value
  ->  Scan Table attrib_value
  ->  Scan Table attrib_value
  ->  Scan Table object_reference
  ->  Scan Table object_reference
  ->  Scan Table object_type
  ->  Scan Table object_type
  ->  Scan Table value_datetime
  ->  Scan Table value_numeric
  ->  Scan Table value_numeric
  ->  Scan Table value_numeric
  ->  Scan Table value_string
  ->  Scan Table value_string
"QUERY PLAN"
"Hash Right Join  (cost=752401.02..2802844.68 rows=77 width=178) (actual time=14335.933..132370.949 rows=20 loops=1)"
"  Hash Cond: ((rw.id)::double precision = (max(nv_2.value)))"
"  ->  Nested Loop  (cost=134.70..2050534.84 rows=15484 width=178) (actual time=1.908..124690.883 rows=83751 loops=1)"
"        ->  Nested Loop  (cost=96.17..1453703.22 rows=15484 width=146) (actual time=1.649..101012.928 rows=83751 loops=1)"
"              ->  Nested Loop  (cost=57.65..856716.77 rows=15484 width=138) (actual time=1.311..74218.546 rows=83751 loops=1)"
"                    ->  Nested Loop  (cost=39.53..575914.18 rows=15484 width=106) (actual time=1.148..57213.783 rows=83751 loops=1)"
"                          ->  Nested Loop  (cost=21.42..294918.04 rows=15484 width=74) (actual time=0.937..38596.361 rows=83751 loops=1)"
"                                ->  Hash Join  (cost=3.30..13960.61 rows=15484 width=42) (actual time=0.513..13434.847 rows=83751 loops=1)"
"                                      Hash Cond: (rw.type_id = tw.id)"
"                                      ->  Seq Scan on object_reference rw  (cost=0.00..12653.43 rows=474843 width=51) (actual time=0.083..6437.157 rows=474843 loops=1)"
"                                      ->  Hash  (cost=3.26..3.26 rows=3 width=9) (actual time=0.202..0.230 rows=3 loops=1)"
"                                            Buckets: 1024  Batches: 1  Memory Usage: 9kB"
"                                            ->  Seq Scan on object_type tw  (cost=0.00..3.26 rows=3 width=9) (actual time=0.099..0.156 rows=3 loops=1)"
"                                                  Filter: ((mnemo)::text = ANY ('{Dvl,Clt,Cnt}'::text[]))"
"                                                  Rows Removed by Filter: 89"
"                                ->  Subquery Scan on vv0  (cost=18.12..18.14 rows=1 width=32) (actual time=0.203..0.248 rows=1 loops=83751)"
"                                      ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.177..0.191 rows=1 loops=83751)"
"                                            ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.124..0.141 rows=0 loops=83751)"
"                                                  ->  Index Scan using object_reference_ndx2 on attrib_value av  (cost=0.56..9.67 rows=1 width=10) (actual time=0.081..0.087 rows=0 loops=83751)"
"                                                        Index Cond: ((object_id = rw.id) AND (attrib_id = '100000016000000'::numeric))"
"                                                  ->  Index Scan using value_string_pkey on value_string sv  (cost=0.42..8.44 rows=1 width=142) (actual time=0.040..0.040 rows=1 loops=28086)"
"                                                        Index Cond: (id = av.value_id)"
"                          ->  Subquery Scan on vv1  (cost=18.12..18.14 rows=1 width=32) (actual time=0.137..0.174 rows=1 loops=83751)"
"                                ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.106..0.119 rows=1 loops=83751)"
"                                      ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.068..0.078 rows=0 loops=83751)"
"                                            ->  Index Scan using object_reference_ndx2 on attrib_value av_1  (cost=0.56..9.67 rows=1 width=10) (actual time=0.032..0.037 rows=0 loops=83751)"
"                                                  Index Cond: ((object_id = rw.id) AND (attrib_id = '3000000000002'::numeric))"
"                                            ->  Index Scan using value_string_pkey on value_string sv_1  (cost=0.42..8.44 rows=1 width=142) (actual time=0.027..0.027 rows=1 loops=18667)"
"                                                  Index Cond: (id = av_1.value_id)"
"                    ->  Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.136..0.150 rows=1 loops=83751)"
"                          ->  Nested Loop  (cost=0.99..18.11 rows=1 width=132) (actual time=0.096..0.104 rows=0 loops=83751)"
"                                ->  Index Scan using object_reference_ndx2 on attrib_value av_2  (cost=0.56..9.67 rows=1 width=10) (actual time=0.039..0.042 rows=0 loops=83751)"
"                                      Index Cond: ((object_id = rw.id) AND (attrib_id = '100004974000000'::numeric))"
"                                ->  Index Scan using value_string_pkey on value_string sv_2  (cost=0.42..8.44 rows=1 width=142) (actual time=0.104..0.104 rows=1 loops=18482)"
"                                      Index Cond: (id = av_2.value_id)"
"              ->  Subquery Scan on vv4  (cost=38.53..38.55 rows=1 width=8) (actual time=0.236..0.273 rows=1 loops=83751)"
"                    ->  Aggregate  (cost=38.53..38.54 rows=1 width=8) (actual time=0.210..0.224 rows=1 loops=83751)"
"                          ->  Nested Loop  (cost=0.99..38.52 rows=3 width=8) (actual time=0.137..0.168 rows=1 loops=83751)"
"                                ->  Index Scan using object_reference_ndx2 on attrib_value av_3  (cost=0.56..13.19 rows=3 width=10) (actual time=0.048..0.061 rows=1 loops=83751)"
"                                      Index Cond: ((object_id = rw.id) AND (attrib_id = '8'::numeric))"
"                                ->  Index Only Scan using ""ric-value_datetime-09d9596e"" on value_datetime dv  (cost=0.42..8.44 rows=1 width=18) (actual time=0.057..0.057 rows=1 loops=67107)"
"                                      Index Cond: (id = av_3.value_id)"
"                                      Heap Fetches: 67107"
"        ->  Aggregate  (cost=38.53..38.54 rows=1 width=32) (actual time=0.212..0.225 rows=1 loops=83751)"
"              ->  Nested Loop  (cost=0.99..38.52 rows=3 width=132) (actual time=0.131..0.171 rows=1 loops=83751)"
"                    ->  Index Scan using object_reference_ndx2 on attrib_value av_4  (cost=0.56..13.19 rows=3 width=10) (actual time=0.047..0.060 rows=1 loops=83751)"
"                          Index Cond: ((object_id = rw.id) AND (attrib_id = '3000000000122'::numeric))"
"                    ->  Index Scan using value_string_pkey on value_string sv_3  (cost=0.42..8.44 rows=1 width=142) (actual time=0.029..0.029 rows=1 loops=83751)"
"                          Index Cond: (id = av_4.value_id)"
"  ->  Hash  (cost=752266.31..752266.31 rows=1 width=8) (actual time=6041.422..6042.066 rows=20 loops=1)"
"        Buckets: 1024  Batches: 1  Memory Usage: 9kB"
"        ->  Unique  (cost=752240.51..752266.31 rows=1 width=8) (actual time=6039.994..6041.746 rows=20 loops=1)"
"              ->  Sort  (cost=752240.51..752253.41 rows=5161 width=8) (actual time=6039.967..6041.020 rows=57 loops=1)"
"                    Sort Key: (max(nv_2.value))"
"                    Sort Method: quicksort  Memory: 25kB"
"                    ->  Nested Loop  (cost=342.03..751922.24 rows=5161 width=8) (actual time=3555.909..6039.931 rows=57 loops=1)"
"                          ->  Nested Loop  (cost=313.71..605659.28 rows=5161 width=10) (actual time=3555.476..6027.279 rows=57 loops=1)"
"                                ->  Nested Loop  (cost=264.98..353982.70 rows=5161 width=10) (actual time=3555.036..5968.482 rows=59 loops=1)"
"                                      ->  Nested Loop  (cost=216.25..102306.11 rows=5161 width=10) (actual time=3554.509..5956.202 rows=59 loops=1)"
"                                            ->  Nested Loop  (cost=198.13..8633.88 rows=5161 width=10) (actual time=7.242..938.726 rows=15409 loops=1)"
"                                                  ->  Seq Scan on object_type tw_1  (cost=0.00..3.15 rows=1 width=9) (actual time=0.123..0.187 rows=1 loops=1)"
"                                                        Filter: ((mnemo)::text = 'Lst'::text)"
"                                                        Rows Removed by Filter: 91"
"                                                  ->  Bitmap Heap Scan on object_reference rw_1  (cost=198.13..8545.94 rows=8479 width=19) (actual time=7.033..467.996 rows=15409 loops=1)"
"                                                        Recheck Cond: (type_id = tw_1.id)"
"                                                        Heap Blocks: exact=5230"
"                                                        ->  Bitmap Index Scan on ""ric-object_reference-ccd76827""  (cost=0.00..196.02 rows=8479 width=0) (actual time=5.145..5.163 rows=15409 loops=1)"
"                                                              Index Cond: (type_id = tw_1.id)"
"                                            ->  Aggregate  (cost=18.12..18.13 rows=1 width=8) (actual time=0.285..0.285 rows=0 loops=15409)"
"                                                  Filter: ((max(dv_1.value) >= '2023-09-01 00:00:00'::timestamp without time zone) AND (max(dv_1.value) <= '2024-01-01 00:00:00'::timestamp without time zone))"
"                                                  Rows Removed by Filter: 1"
"                                                  ->  Nested Loop  (cost=0.99..18.11 rows=1 width=8) (actual time=0.213..0.253 rows=1 loops=15409)"
"                                                        ->  Index Scan using object_reference_ndx2 on attrib_value av_5  (cost=0.56..9.67 rows=1 width=10) (actual time=0.121..0.134 rows=1 loops=15409)"
"                                                              Index Cond: ((object_id = rw_1.id) AND (attrib_id = '3000000000082'::numeric))"
"                                                        ->  Index Only Scan using ""ric-value_datetime-09d9596e"" on value_datetime dv_1  (cost=0.42..8.44 rows=1 width=18) (actual time=0.046..0.046 rows=1 loops=14785)"
"                                                              Index Cond: (id = av_5.value_id)"
"                                                              Heap Fetches: 14785"
"                                      ->  Aggregate  (cost=48.73..48.75 rows=1 width=8) (actual time=0.160..0.170 rows=1 loops=59)"
"                                            Filter: (abs(max(nv.value)) = '50'::double precision)"
"                                            ->  Nested Loop  (cost=0.99..48.72 rows=4 width=8) (actual time=0.093..0.131 rows=1 loops=59)"
"                                                  ->  Index Scan using object_reference_ndx2 on attrib_value av_6  (cost=0.56..14.95 rows=4 width=10) (actual time=0.036..0.048 rows=1 loops=59)"
"                                                        Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100000019000005'::numeric))"
"                                                  ->  Index Scan using value_numeric_pkey on value_numeric nv  (cost=0.42..8.44 rows=1 width=18) (actual time=0.023..0.023 rows=1 loops=59)"
"                                                        Index Cond: (id = av_6.value_id)"
"                                ->  Aggregate  (cost=48.73..48.75 rows=1 width=8) (actual time=0.948..0.958 rows=1 loops=59)"
"                                      Filter: (abs(max(nv_1.value)) >= '28673'::double precision)"
"                                      Rows Removed by Filter: 0"
"                                      ->  Nested Loop  (cost=0.99..48.72 rows=4 width=8) (actual time=0.890..0.918 rows=1 loops=59)"
"                                            ->  Index Scan using object_reference_ndx2 on attrib_value av_7  (cost=0.56..14.95 rows=4 width=10) (actual time=0.833..0.843 rows=1 loops=59)"
"                                                  Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100004060500000'::numeric))"
"                                            ->  Index Scan using value_numeric_pkey on value_numeric nv_1  (cost=0.42..8.44 rows=1 width=18) (actual time=0.023..0.024 rows=1 loops=59)"
"                                                  Index Cond: (id = av_7.value_id)"
"                          ->  Aggregate  (cost=28.32..28.33 rows=1 width=8) (actual time=0.176..0.185 rows=1 loops=57)"
"                                ->  Nested Loop  (cost=0.99..28.32 rows=2 width=8) (actual time=0.120..0.147 rows=1 loops=57)"
"                                      ->  Index Scan using object_reference_ndx2 on attrib_value av_8  (cost=0.56..11.43 rows=2 width=10) (actual time=0.027..0.037 rows=1 loops=57)"
"                                            Index Cond: ((object_id = rw_1.id) AND (attrib_id = '100004060300000'::numeric))"
"                                      ->  Index Scan using value_numeric_pkey on value_numeric nv_2  (cost=0.42..8.44 rows=1 width=18) (actual time=0.058..0.059 rows=1 loops=57)"
"                                            Index Cond: (id = av_8.value_id)"
"Planning Time: 18.793 ms"
"Execution Time: 132373.249 ms"
-- type_id :: ?(=)
CREATE INDEX CONCURRENTLY "~object_reference-ccd76827"
  ON object_reference(type_id);
 7
# 6 Hash Join
Execution6997.460ms5.3%: rows=83751, loops=1
Cost13960.61: rows=15484 width=42
Hash Join  (cost=3.30..13960.61 rows=15484 width=42) (actual time=0.513..13434.847 rows=83751 loops=1)
  Hash Cond: (rw.type_id = tw.id)
# 7 Seq Scan on object_reference rw
Execution6437.157ms4.9%: rows=474843, loops=1
Cost12653.43: rows=474843 width=51
Seq Scan on object_reference rw  (cost=0.00..12653.43 rows=474843 width=51) (actual time=0.083..6437.157 rows=474843 loops=1)
-- type_id :: ?(=)
CREATE INDEX CONCURRENTLY "~object_reference-ccd76827"
  ON object_reference(type_id);
# 7 Seq Scan on object_reference rw HR
Execution6437.157ms4.9%: rows=474843, loops=1
Cost12653.43: rows=474843 width=51
Seq Scan on object_reference rw  (cost=0.00..12653.43 rows=474843 width=51) (actual time=0.083..6437.157 rows=474843 loops=1)
HR
->  Hash Join
    rows=83751
    ->  Seq Scan on object_reference rw
        rows=474843
Рекомендации [подробнее] [возможные индексы]:
- вероятно, отсутствует индекс для foreign key
# 13 Index Scan using object_reference_ndx2 on attrib_value av RR
Execution7286.337ms5.5%: rows=0, loops=83751
Cost9.67: rows=1 width=10
Index Scan using object_reference_ndx2 on attrib_value av  (cost=0.56..9.67 rows=1 width=10) (actual time=0.081..0.087 rows=0 loops=83751)
  Index Cond: ((object_id = rw.id) AND (attrib_id = '100000016000000'::numeric))
RR
->  Index Scan using object_reference_ndx2 on attrib_value av
    rows-act=0, rows-pre=83751
Рекомендации [подробнее]:
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE
# 16 Aggregate CC
Execution3433.791ms2.6%: rows=83751 (1), loops=83751
Cost18.13: rows=1 width=32
Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.106..0.119 rows=1 loops=83751)
CC
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_1
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_1
            node #14
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
# 18 Index Scan using object_reference_ndx2 on attrib_value av_1 RR
Execution3098.787ms2.3%: rows=0, loops=83751
Cost9.67: rows=1 width=10
Index Scan using object_reference_ndx2 on attrib_value av_1  (cost=0.56..9.67 rows=1 width=10) (actual time=0.032..0.037 rows=0 loops=83751)
  Index Cond: ((object_id = rw.id) AND (attrib_id = '3000000000002'::numeric))
RR
->  Index Scan using object_reference_ndx2 on attrib_value av_1
    rows-act=0, rows-pre=83751
Рекомендации [подробнее]:
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE
# 20 Aggregate CC
Execution3852.546ms2.9%: rows=83751 (1), loops=83751
Cost18.13: rows=1 width=32
Aggregate  (cost=18.12..18.13 rows=1 width=32) (actual time=0.136..0.150 rows=1 loops=83751)
CC
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_2
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_2
            node #14
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
# 22 Index Scan using object_reference_ndx2 on attrib_value av_2 RR
Execution3517.542ms2.7%: rows=0, loops=83751
Cost9.67: rows=1 width=10
Index Scan using object_reference_ndx2 on attrib_value av_2  (cost=0.56..9.67 rows=1 width=10) (actual time=0.039..0.042 rows=0 loops=83751)
  Index Cond: ((object_id = rw.id) AND (attrib_id = '100004974000000'::numeric))
RR
->  Index Scan using object_reference_ndx2 on attrib_value av_2
    rows-act=0, rows-pre=83751
Рекомендации [подробнее]:
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE
# 28 Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv HF
Execution3825.099ms2.9%: rows=67107 (1), loops=67107
Cost8.44: rows=1 width=18
Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv  (cost=0.42..8.44 rows=1 width=18) (actual time=0.057..0.057 rows=1 loops=67107)
  Index Cond: (id = av_3.value_id)
  Heap Fetches: 67107
HF
->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv
    100.0% (heap=67107 : rows=67107)
Рекомендации [подробнее]:
- cтоит выполнить VACUUM, чтобы не обращаться к таблице
# 29 Aggregate CC
Execution4522.554ms3.4%: rows=83751 (1), loops=83751
Cost38.54: rows=1 width=32
Aggregate  (cost=38.53..38.54 rows=1 width=32) (actual time=0.212..0.225 rows=1 loops=83751)
CC
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_4
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_3
            node #14
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
# 44 Aggregate CC
Execution493.088ms0.4%: rows=0 RRbF=15409 (1), loops=15409
Cost18.13: rows=1 width=8
Aggregate  (cost=18.12..18.13 rows=1 width=8) (actual time=0.285..0.285 rows=0 loops=15409)
  Filter: ((max(dv_1.value) >= '2023-09-01 00:00:00'::timestamp without time zone) AND (max(dv_1.value) <= '2024-01-01 00:00:00'::timestamp without time zone))
  Rows Removed by Filter: 1
CC
->  Aggregate
    node #25
    ->  Nested Loop
        node #26
        ->  Index Scan using object_reference_ndx2 on attrib_value av_5
            node #27
        ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1
            node #28
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
# 47 Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1 HF
Execution680.110ms0.5%: rows=14785 (1), loops=14785
Cost8.44: rows=1 width=18
Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1  (cost=0.42..8.44 rows=1 width=18) (actual time=0.046..0.046 rows=1 loops=14785)
  Index Cond: (id = av_5.value_id)
  Heap Fetches: 14785
HF
->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1
    100.0% (heap=14785 : rows=14785)
Рекомендации [подробнее]:
- cтоит выполнить VACUUM, чтобы не обращаться к таблице
# 52 Aggregate CC
Execution2.360ms0.0%: rows=59 (1), loops=59
Cost48.75: rows=1 width=8
Aggregate  (cost=48.73..48.75 rows=1 width=8) (actual time=0.948..0.958 rows=1 loops=59)
  Filter: (abs(max(nv_1.value)) >= '28673'::double precision)
  Rows Removed by Filter: 0
CC
->  Aggregate
    node #48
    ->  Nested Loop
        node #49
        ->  Index Scan using object_reference_ndx2 on attrib_value av_7
            node #50
        ->  Index Scan using value_numeric_pkey on value_numeric nv_1
            node #51
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
# 56 Aggregate CC
Execution2.166ms0.0%: rows=57 (1), loops=57
Cost28.33: rows=1 width=8
Aggregate  (cost=28.32..28.33 rows=1 width=8) (actual time=0.176..0.185 rows=1 loops=57)
CC
->  Aggregate
    node #48
    ->  Nested Loop
        node #49
        ->  Index Scan using object_reference_ndx2 on attrib_value av_8
            node #50
        ->  Index Scan using value_numeric_pkey on value_numeric nv_2
            node #51
Рекомендации [подробнее]:
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
Рекомендации :
- вероятно, отсутствует индекс для foreign key
#7
->  Hash Join
    rows=83751
    ->  Seq Scan on object_reference rw
        rows=474843
Рекомендации :
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE
#13
->  Index Scan using object_reference_ndx2 on attrib_value av
    rows-act=0, rows-pre=83751
#18
->  Index Scan using object_reference_ndx2 on attrib_value av_1
    rows-act=0, rows-pre=83751
#22
->  Index Scan using object_reference_ndx2 on attrib_value av_2
    rows-act=0, rows-pre=83751
Рекомендации :
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений
#16
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_1
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_1
            node #14
#20
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_2
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_2
            node #14
#29
->  Aggregate
    node #11
    ->  Nested Loop
        node #12
        ->  Index Scan using object_reference_ndx2 on attrib_value av_4
            node #13
        ->  Index Scan using value_string_pkey on value_string sv_3
            node #14
#44
->  Aggregate
    node #25
    ->  Nested Loop
        node #26
        ->  Index Scan using object_reference_ndx2 on attrib_value av_5
            node #27
        ->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1
            node #28
#52
->  Aggregate
    node #48
    ->  Nested Loop
        node #49
        ->  Index Scan using object_reference_ndx2 on attrib_value av_7
            node #50
        ->  Index Scan using value_numeric_pkey on value_numeric nv_1
            node #51
#56
->  Aggregate
    node #48
    ->  Nested Loop
        node #49
        ->  Index Scan using object_reference_ndx2 on attrib_value av_8
            node #50
        ->  Index Scan using value_numeric_pkey on value_numeric nv_2
            node #51
Рекомендации :
- cтоит выполнить VACUUM, чтобы не обращаться к таблице
#28
->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv
    100.0% (heap=67107 : rows=67107)
#47
->  Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1
    100.0% (heap=14785 : rows=14785)
время % rows RRbF % loops тип узла таблица индекс узлы
45511.739
34.4
617482
434349
Nested Loop
1 2 3 4 5 12 17 21 26 30 36 37 38 39 40 45 49 53 57
19
26156.021
19.8
183086
434339
Index Scan
attrib_value
object_reference_ndx2
13 18 22 27 31 46 50 54 58
9
21186.412
16.0
418930
15409
3.5
434339
Aggregate
11 16 20 25 29 44 48 52 56
9
6997.460
5.3
83751
Hash Join
6
6437.157
4.9
474843
Seq Scan
object_reference
7
5978.356
4.5
148986
148986
Index Scan
value_string
value_string_pkey
14 19 23 32
4
4773.807
3.6
83751
83751
Subquery Scan
vv0
10
4606.305
3.5
83751
83751
Subquery Scan
vv1
15
4505.209
3.4
81892
81892
Index Only Scan
value_datetime
ric-value_datetime-09d9596e
28 47
2
4103.799
3.1
83751
83751
Subquery Scan
vv4
24
1638.000
1.2
20
Hash Right Join
0
462.833
0.3
15409
Bitmap Heap Scan
object_reference
42
6.136
0.0
175
175
Index Scan
value_numeric
value_numeric_pkey
51 55 59
3
5.163
0.0
15409
Bitmap Index Scan
object_reference
ric-object_reference-ccd76827
43
1.089
0.0
57
Sort
35
.726
0.0
20
Unique
34
.394
0.0
23
2
Hash
8 33
2
.343
0.0
4
180
97.8
2
Seq Scan
object_type
9 41
2
tooltip