HR
#7
-> Hash Join |
rows=83751 |
-> Seq Scan on object_reference rw |
rows=474843 |
Рекомендации [подробнее] [возможные индексы]: |
- вероятно, отсутствует индекс для foreign key |
RR
#13
-> Index Scan using object_reference_ndx2 on attrib_value av |
rows-act=0, rows-pre=83751 |
Рекомендации [подробнее]: |
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
RR
#18
-> Index Scan using object_reference_ndx2 on attrib_value av_1 |
rows-act=0, rows-pre=83751 |
Рекомендации [подробнее]: |
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
RR
#22
-> Index Scan using object_reference_ndx2 on attrib_value av_2 |
rows-act=0, rows-pre=83751 |
Рекомендации [подробнее]: |
- сильно расходится плановая и фактическая статистика по таблице, стоит выполнить ее ANALYZE |
HF
#28
-> Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv |
100.0% (heap=67107 : rows=67107) |
Рекомендации [подробнее]: |
- cтоит выполнить VACUUM, чтобы не обращаться к таблице |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
HF
#47
-> Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1 |
100.0% (heap=14785 : rows=14785) |
Рекомендации [подробнее]: |
- cтоит выполнить VACUUM, чтобы не обращаться к таблице |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
CC
#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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
#13
IS |
#44
A |
tilemap |
piechart
#
|
node, ms
|
tree, ms
|
rows
|
|
RRbF
|
|
loops
|
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
132′370.949 | 20 | 15′589 | |||||||||||||||||||||||||||
0 | 1′638.000
| 132′370.949
| 20
| ▼ |
| ||||||||||||||||||||||||
1 | 4′833.980
| 124′690.883
| 83′751
| ▲ |
| ||||||||||||||||||||||||
2 | 3′930.359
| 101′012.928
| 83′751
| ▲ |
| ||||||||||||||||||||||||
3 | 4′442.113
| 74′218.546
| 83′751
| ▲ |
| ||||||||||||||||||||||||
4 | 4′044.748
| 57′213.783
| 83′751
| ▲ |
| ||||||||||||||||||||||||
5 | 4′391.266
| 38′596.361
| 83′751
| ▲ |
| ||||||||||||||||||||||||
6 | 6′997.460
| 13′434.847
| 83′751
| ▲ |
| ||||||||||||||||||||||||
7 | 6′437.157
| 474′843
| HR
|
| |||||||||||||||||||||||||
8 | .074
| .230
| 3
|
| |||||||||||||||||||||||||
9 | .156
| 3
| 89
| 96.7% |
| ||||||||||||||||||||||||
10 | 4′773.807
| 20′770.248
| 83′751
| 83′751 |
| ||||||||||||||||||||||||
11 | 4′187.550
| 15′996.441
| 83′751
| 83′751 |
| ||||||||||||||||||||||||
12 | 3′399.114
| 11′808.891
| 83′751 |
| |||||||||||||||||||||||||
13 | 7′286.337
| 83′751 | RR
|
| |||||||||||||||||||||||||
14 | 1′123.440
| 28′086
| 28′086 |
| |||||||||||||||||||||||||
15 | 4′606.305
| 14′572.674
| 83′751
| 83′751 |
| ||||||||||||||||||||||||
16 | 3′433.791
| 9′966.369
| 83′751
| 83′751 | CC
|
| |||||||||||||||||||||||
17 | 2′929.782
| 6′532.578
| 83′751 |
| |||||||||||||||||||||||||
18 | 3′098.787
| 83′751 | RR
|
| |||||||||||||||||||||||||
19 | 504.009
| 18′667
| 18′667 |
| |||||||||||||||||||||||||
20 | 3′852.546
| 12′562.650
| 83′751
| 83′751 | CC
|
| |||||||||||||||||||||||
21 | 3′270.434
| 8′710.104
| 83′751 |
| |||||||||||||||||||||||||
22 | 3′517.542
| 83′751 | RR
|
| |||||||||||||||||||||||||
23 | 1′922.128
| 18′482
| 18′482 |
| |||||||||||||||||||||||||
24 | 4′103.799
| 22′864.023
| 83′751
| 83′751 |
| ||||||||||||||||||||||||
25 | 4′690.056
| 18′760.224
| 83′751
| 83′751 |
| ||||||||||||||||||||||||
26 | 5′136.258
| 14′070.168
| 83′751
| ▼ | 83′751 |
| |||||||||||||||||||||||
27 | 5′108.811
| 83′751
| ▼ | 83′751 |
| ||||||||||||||||||||||||
28 | 3′825.099
| 67′107
| 67′107 | HF
|
| ||||||||||||||||||||||||
29 | 4′522.554
| 18′843.975
| 83′751
| 83′751 | CC
|
| |||||||||||||||||||||||
30 | 6′867.582
| 14′321.421
| 83′751
| ▼ | 83′751 |
| |||||||||||||||||||||||
31 | 5′025.060
| 83′751
| ▼ | 83′751 |
| ||||||||||||||||||||||||
32 | 2′428.779
| 83′751
| 83′751 |
| |||||||||||||||||||||||||
33 | .320
| 6′042.066
| 20
| ▲ |
| ||||||||||||||||||||||||
34 | .726
| 6′041.746
| 20
| ▲ |
| ||||||||||||||||||||||||
35 | 1.089
| 6′041.020
| 57
| ▼ |
| ||||||||||||||||||||||||
36 | 2.107
| 6′039.931
| 57
| ▼ |
| ||||||||||||||||||||||||
37 | 2.275
| 6′027.279
| 57
| ▼ |
| ||||||||||||||||||||||||
38 | 2.250
| 5′968.482
| 59
| ▼ |
| ||||||||||||||||||||||||
39 | 625.911
| 5′956.202
| 59
| ▼ |
| ||||||||||||||||||||||||
40 | 470.543
| 938.726
| 15′409
| ▲ |
| ||||||||||||||||||||||||
41 | .187
| 1
| 91
| 98.9% |
| ||||||||||||||||||||||||
42 | 462.833
| 467.996
| 15′409
| ▲ |
| ||||||||||||||||||||||||
43 | 5.163
| 15′409
| ▲ |
| |||||||||||||||||||||||||
44 | 493.088
| 4′391.565
| 15′409
| 100.0% | 15′409 | CC
|
| ||||||||||||||||||||||
45 | 1′153.561
| 3′898.477
| 15′409
| 15′409 |
| ||||||||||||||||||||||||
46 | 2′064.806
| 15′409
| 15′409 |
| |||||||||||||||||||||||||
47 | 680.110
| 14′785
| 14′785 | HF
|
| ||||||||||||||||||||||||
48 | 2.301
| 10.030
| 59
| 59 |
| ||||||||||||||||||||||||
49 | 3.540
| 7.729
| 59
| ▼ | 59 |
| |||||||||||||||||||||||
50 | 2.832
| 59
| ▼ | 59 |
| ||||||||||||||||||||||||
51 | 1.357
| 59
| 59 |
| |||||||||||||||||||||||||
52 | 2.360
| 56.522
| 59
| 0.0% | 59 | CC
|
| ||||||||||||||||||||||
53 | 3.009
| 54.162
| 59
| ▼ | 59 |
| |||||||||||||||||||||||
54 | 49.737
| 59
| ▼ | 59 |
| ||||||||||||||||||||||||
55 | 1.416
| 59
| 59 |
| |||||||||||||||||||||||||
56 | 2.166
| 10.545
| 57
| 57 | CC
|
| |||||||||||||||||||||||
57 | 2.907
| 8.379
| 57
| ▼ | 57 |
| |||||||||||||||||||||||
58 | 2.109
| 57
| ▼ | 57 |
| ||||||||||||||||||||||||
59 | 3.363
| 57
| 57 |
| |||||||||||||||||||||||||
18.793 |
| ||||||||||||||||||||||||||||
2.300 | 132′373.249 |
| |||||||||||||||||||||||||||
Hash Right Join (cost=752′401.02..2′802′844.68 rows=77 width=178) (actual time=14′335.933..132′370.949 rows=20 loops=1) Hash Cond: ((rw.id)::double precision = (max(nv_2.value))) -> Nested Loop (cost=134.70..2′050′534.84 rows=15′484 width=178) (actual time=1.908..124′690.883 rows=83′751 loops=1) -> Nested Loop (cost=96.17..1′453′703.22 rows=15′484 width=146) (actual time=1.649..101′012.928 rows=83′751 loops=1) -> Nested Loop (cost=57.65..856′716.77 rows=15′484 width=138) (actual time=1.311..74′218.546 rows=83′751 loops=1) -> Nested Loop (cost=39.53..575′914.18 rows=15′484 width=106) (actual time=1.148..57′213.783 rows=83′751 loops=1) -> Nested Loop (cost=21.42..294′918.04 rows=15′484 width=74) (actual time=0.937..38′596.361 rows=83′751 loops=1) -> Hash Join (cost=3.30..13′960.61 rows=15′484 width=42) (actual time=0.513..13′434.847 rows=83′751 loops=1) Hash Cond: (rw.type_id = tw.id) -> Seq Scan on object_reference rw (cost=0.00..12′653.43 rows=474′843 width=51) (actual time=0.083..6′437.157 rows=474′843 loops=1) -> Hash (cost=3.26..3.26 rows=3 width=9) (actual time=0.202..0.230 rows=3 loops=1) Buckets: 1′024 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=83′751) -> Aggregate (cost=18.12..18.13 rows=1 width=32) (actual time=0.177..0.191 rows=1 loops=83′751) -> Nested Loop (cost=0.99..18.11 rows=1 width=132) (actual time=0.124..0.141 rows=0 loops=83′751) -> 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=83′751) 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=28′086) 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=83′751) -> Aggregate (cost=18.12..18.13 rows=1 width=32) (actual time=0.106..0.119 rows=1 loops=83′751) -> Nested Loop (cost=0.99..18.11 rows=1 width=132) (actual time=0.068..0.078 rows=0 loops=83′751) -> 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=83′751) 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=18′667) 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=83′751) -> Nested Loop (cost=0.99..18.11 rows=1 width=132) (actual time=0.096..0.104 rows=0 loops=83′751) -> 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=83′751) 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=18′482) 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=83′751) -> Aggregate (cost=38.53..38.54 rows=1 width=8) (actual time=0.210..0.224 rows=1 loops=83′751) -> Nested Loop (cost=0.99..38.52 rows=3 width=8) (actual time=0.137..0.168 rows=1 loops=83′751) -> 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=83′751) 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=67′107) Index Cond: (id = av_3.value_id) Heap Fetches: 67′107 -> Aggregate (cost=38.53..38.54 rows=1 width=32) (actual time=0.212..0.225 rows=1 loops=83′751) -> Nested Loop (cost=0.99..38.52 rows=3 width=132) (actual time=0.131..0.171 rows=1 loops=83′751) -> 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=83′751) 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=83′751) Index Cond: (id = av_4.value_id) -> Hash (cost=752′266.31..752′266.31 rows=1 width=8) (actual time=6′041.422..6′042.066 rows=20 loops=1) Buckets: 1′024 Batches: 1 Memory Usage: 9kB -> Unique (cost=752′240.51..752′266.31 rows=1 width=8) (actual time=6′039.994..6′041.746 rows=20 loops=1) -> Sort (cost=752′240.51..752′253.41 rows=5′161 width=8) (actual time=6′039.967..6′041.020 rows=57 loops=1) Sort Key: (max(nv_2.value)) Sort Method: quicksort Memory: 25kB -> Nested Loop (cost=342.03..751′922.24 rows=5′161 width=8) (actual time=3′555.909..6′039.931 rows=57 loops=1) -> Nested Loop (cost=313.71..605′659.28 rows=5′161 width=10) (actual time=3′555.476..6′027.279 rows=57 loops=1) -> Nested Loop (cost=264.98..353′982.70 rows=5′161 width=10) (actual time=3′555.036..5′968.482 rows=59 loops=1) -> Nested Loop (cost=216.25..102′306.11 rows=5′161 width=10) (actual time=3′554.509..5′956.202 rows=59 loops=1) -> Nested Loop (cost=198.13..8′633.88 rows=5′161 width=10) (actual time=7.242..938.726 rows=15′409 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..8′545.94 rows=8′479 width=19) (actual time=7.033..467.996 rows=15′409 loops=1) Recheck Cond: (type_id = tw_1.id) Heap Blocks: exact=5′230 -> Bitmap Index Scan on "ric-object_reference-ccd76827" (cost=0.00..196.02 rows=8′479 width=0) (actual time=5.145..5.163 rows=15′409 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=15′409) 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=15′409) -> 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=15′409) 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=14′785) Index Cond: (id = av_5.value_id) Heap Fetches: 14′785 -> 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: 132′373.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 |
| ||||||||||
| ||||||||||
Hash Join (cost=3.30..13′960.61 rows=15′484 width=42) (actual time=0.513..13′434.847 rows=83′751 loops=1) Hash Cond: (rw.type_id = tw.id) |
| ||||||||||
| ||||||||||
Seq Scan on object_reference rw (cost=0.00..12′653.43 rows=474′843 width=51) (actual time=0.083..6′437.157 rows=474′843 loops=1) |
-- type_id :: ?(=) CREATE INDEX CONCURRENTLY "~object_reference-ccd76827" ON object_reference(type_id);
| ||||||||||
| ||||||||||
Seq Scan on object_reference rw (cost=0.00..12′653.43 rows=474′843 width=51) (actual time=0.083..6′437.157 rows=474′843 loops=1) |
HR
-> Hash Join |
rows=83751 |
-> Seq Scan on object_reference rw |
rows=474843 |
Рекомендации [подробнее] [возможные индексы]: |
- вероятно, отсутствует индекс для foreign key |
| ||||||||||
| ||||||||||
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=83′751) 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 |
| |||||||||||||
| |||||||||||||
Aggregate (cost=18.12..18.13 rows=1 width=32) (actual time=0.106..0.119 rows=1 loops=83′751) |
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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
| ||||||||||
| ||||||||||
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=83′751) 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 |
| |||||||||||||
| |||||||||||||
Aggregate (cost=18.12..18.13 rows=1 width=32) (actual time=0.136..0.150 rows=1 loops=83′751) |
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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
| ||||||||||
| ||||||||||
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=83′751) 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 |
| ||||||||||
| ||||||||||
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=67′107) Index Cond: (id = av_3.value_id) Heap Fetches: 67′107 |
HF
-> Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv |
100.0% (heap=67107 : rows=67107) |
Рекомендации [подробнее]: |
- cтоит выполнить VACUUM, чтобы не обращаться к таблице |
| |||||||||||||
| |||||||||||||
Aggregate (cost=38.53..38.54 rows=1 width=32) (actual time=0.212..0.225 rows=1 loops=83′751) |
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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
| |||||||||||||
| |||||||||||||
Aggregate (cost=18.12..18.13 rows=1 width=8) (actual time=0.285..0.285 rows=0 loops=15′409) 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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
| ||||||||||
| ||||||||||
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=14′785) Index Cond: (id = av_5.value_id) Heap Fetches: 14′785 |
HF
-> Index Only Scan using "ric-value_datetime-09d9596e" on value_datetime dv_1 |
100.0% (heap=14785 : rows=14785) |
Рекомендации [подробнее]: |
- cтоит выполнить VACUUM, чтобы не обращаться к таблице |
| |||||||||||||
| |||||||||||||
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 |
Рекомендации [подробнее]: |
- устраните повторное выполнение одинакового кода с помощью сохранения результата или совместного вычисления значений |
| |||||||||||||
| |||||||||||||
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 | тип узла | таблица | индекс | узлы | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|
45′511.739
|
34.4
|
617′482
|
434′349
| Nested Loop | 1 2 3 4 5 12 17 21 26 30 36 37 38 39 40 45 49 53 57 |
19
| ||||||
26′156.021
|
19.8
|
183′086
|
434′339
| Index Scan | 13 18 22 27 31 46 50 54 58 |
9
| ||||||
21′186.412
|
16.0
|
418′930
|
15′409
| 3.5 |
434′339
| Aggregate | 11 16 20 25 29 44 48 52 56 |
9
| ||||
6′997.460
|
5.3
|
83′751
| Hash Join | 6 | ||||||||
6′437.157
|
4.9
|
474′843
| Seq Scan | 7 | ||||||||
5′978.356
|
4.5
|
148′986
|
148′986
| Index Scan | 14 19 23 32 |
4
| ||||||
4′773.807
|
3.6
|
83′751
|
83′751
| Subquery Scan | 10 | |||||||
4′606.305
|
3.5
|
83′751
|
83′751
| Subquery Scan | 15 | |||||||
4′505.209
|
3.4
|
81′892
|
81′892
| Index Only Scan | 28 47 |
2
| ||||||
4′103.799
|
3.1
|
83′751
|
83′751
| Subquery Scan | 24 | |||||||
1′638.000
|
1.2
|
20
| Hash Right Join | 0 | ||||||||
462.833
|
0.3
|
15′409
| Bitmap Heap Scan | 42 | ||||||||
6.136
|
0.0
|
175
|
175
| Index Scan | 51 55 59 |
3
| ||||||
5.163
|
0.0
|
15′409
| Bitmap Index Scan | 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 | 9 41 |
2
|