2024-12-26 16:52:55.611
3daf3d33bad37925dc6e4e01ba1c78c3
 1.990 ms
tilemap |  piechart
time | bufferstilemap
#
node, ms
tree, ms
rows
RRbF
loops
node
tm.wr
2635942.015116901
итоговые результаты (8B = rows=1 x width=8)
22359373
0
3.005
2635942.015
1
Aggregate
1
  CTE matrix
2
5.046
5.640
1
   ->  Aggregate
3
.594
130
2
1.5%
        ->  Function Scan on regexp_split_to_table line
4
  CTE dir
5
.004
1
   ->  Result
6
  CTE src
7
.006
570.975
1
   ->  Nested Loop
8
.076
5.716
1
        ->  CTE Scan on matrix
9
563.880
565.253
1
16899
100.0%
        ->  Nested Loop
10
.073
130
             ->  Function Scan on generate_subscripts x
11
1.211
1.300
16900
130
             ->  Materialize
12
.038
.089
130
                  ->  Nested Loop
13
.003
.007
1
                       ->  CTE Scan on dir
14
.044
130
                       ->  Function Scan on generate_subscripts y
15
  CTE r
16
4.857
1217.085
4858
   ->  Recursive Union
17
-0.003
570.972
1
        ->  CTE Scan on src
18
597.534
641.256
4858
0.0%
4858
        ->  Nested Loop
19
4.858
43.722
4858
4858
             ->  Nested Loop
20
4858
4858
                  ->  CTE Scan on dir dir_1
21
38.864
4858
4858
                  ->  CTE Scan on matrix matrix_1
22
4858
4858
             ->  WorkTable Scan on r r_2
23
12.416
2635939.010
4374
  ->  Nested Loop
24
4.864
1234.572
4374
       ->  Unique
25
6.159
1229.708
4858
            ->  Sort
26
3.245
1223.549
4858
                 ->  WindowAgg
27
1.126
1220.304
4858
                      ->  Sort
28
2.093
1219.178
4858
                           ->  CTE Scan on r
29
22552.344
2634692.022
4374
4374
       ->  Aggregate
425
30
            CTE r
31
65299.106
2103797.772
4404618
4374
             ->  Recursive Union
32
8.747
8.748
4374
4374
                  ->  Result
33
                       InitPlan 5 (returns $10,$11)
34
.001
1
                        ->  CTE Scan on src src_1
35
1985656.486
2038489.918
4402786
0.0%
4402786
                  ->  Nested Loop
36
4402.786
52833.432
4402786
4402786
                       ->  Nested Loop
37
4402786
4402786
                            ->  CTE Scan on dir dir_2
38
48430.646
4402786
4402786
                            ->  CTE Scan on matrix matrix_2
39
4402786
0.0%
4402786
                       ->  WorkTable Scan on r r_3
40
508341.906
2612139.678
4404618
4374
            ->  CTE Scan on r r_1
22358948
Aggregate  (cost=21723482.57..21723482.62 rows=1 width=8) (actual time=2635941.982..2635942.015 rows=1 loops=1)
  Buffers: temp written=22359373
  CTE matrix
    ->  Aggregate  (cost=59.98..60.03 rows=1 width=32) (actual time=5.637..5.640 rows=1 loops=1)
          ->  Function Scan on regexp_split_to_table line  (cost=0.00..55.00 rows=995 width=32) (actual time=0.438..0.594 rows=130 loops=1)
                Filter: (btrim(line) <> ''::text)
                Rows Removed by Filter: 2
  CTE dir
    ->  Result  (cost=0.00..0.05 rows=1 width=128) (actual time=0.002..0.004 rows=1 loops=1)
  CTE src
    ->  Nested Loop  (cost=0.01..55402.71 rows=5000 width=40) (actual time=227.829..570.975 rows=1 loops=1)
          ->  CTE Scan on matrix  (cost=0.00..0.10 rows=1 width=32) (actual time=5.714..5.716 rows=1 loops=1)
          ->  Nested Loop  (cost=0.01..55152.61 rows=5000 width=40) (actual time=222.112..565.253 rows=1 loops=1)
                Join Filter: ((matrix.m)[y.y][x.x] = '^'::text)
                Rows Removed by Join Filter: 16899
                ->  Function Scan on generate_subscripts x  (cost=0.00..50.00 rows=1000 width=4) (actual time=0.023..0.073 rows=130 loops=1)
                ->  Materialize  (cost=0.00..105.10 rows=1000 width=36) (actual time=0.000..0.010 rows=130 loops=130)
                      ->  Nested Loop  (cost=0.00..100.10 rows=1000 width=36) (actual time=0.027..0.089 rows=130 loops=1)
                            ->  CTE Scan on dir  (cost=0.00..0.10 rows=1 width=32) (actual time=0.004..0.007 rows=1 loops=1)
                            ->  Function Scan on generate_subscripts y  (cost=0.00..50.00 rows=1000 width=4) (actual time=0.021..0.044 rows=130 loops=1)
  CTE r
    ->  Recursive Union  (cost=0.00..123027.50 rows=502500 width=44) (actual time=227.834..1217.085 rows=4858 loops=1)
          ->  CTE Scan on src  (cost=0.00..500.00 rows=5000 width=44) (actual time=227.833..570.972 rows=1 loops=1)
          ->  Nested Loop  (cost=0.00..9740.25 rows=49750 width=44) (actual time=0.132..0.132 rows=1 loops=4858)
                Join Filter: (matrix_1.m[(r_2.y + r_2.d[2])][(r_2.x + r_2.d[1])] IS NOT NULL)
                Rows Removed by Join Filter: 0
                ->  Nested Loop  (cost=0.00..0.25 rows=1 width=160) (actual time=0.008..0.009 rows=1 loops=4858)
                      ->  CTE Scan on dir dir_1  (cost=0.00..0.10 rows=1 width=128) (actual time=0.000..0.000 rows=1 loops=4858)
                      ->  CTE Scan on matrix matrix_1  (cost=0.00..0.10 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=4858)
                ->  WorkTable Scan on r r_2  (cost=0.00..5000.00 rows=50000 width=44) (actual time=0.000..0.000 rows=1 loops=4858)
  ->  Nested Loop  (cost=177357.50..21544892.29 rows=40000 width=1) (actual time=1274.696..2635939.010 rows=4374 loops=1)
        Buffers: temp written=22359373
        ->  Unique  (cost=176823.54..180592.29 rows=40000 width=52) (actual time=1225.389..1234.572 rows=4374 loops=1)
              ->  Sort  (cost=176823.54..178079.79 rows=502500 width=52) (actual time=1225.388..1229.708 rows=4858 loops=1)
                    Sort Key: r.x, r.y, r.i
                    Sort Method: quicksort  Memory: 572kB
                    ->  WindowAgg  (cost=97833.64..129239.89 rows=502500 width=52) (actual time=1220.076..1223.549 rows=4858 loops=1)
                          ->  Sort  (cost=97833.64..99089.89 rows=502500 width=44) (actual time=1220.069..1220.304 rows=4858 loops=1)
                                Sort Key: r.i
                                Sort Method: quicksort  Memory: 534kB
                                ->  CTE Scan on r  (cost=0.00..50250.00 rows=502500 width=44) (actual time=227.837..1219.178 rows=4858 loops=1)
        ->  Aggregate  (cost=533.96..534.01 rows=1 width=1) (actual time=602.353..602.353 rows=1 loops=4374)
              Buffers: temp written=22359373
              CTE r
                ->  Recursive Union  (cost=500.00..528.73 rows=51 width=73) (actual time=0.004..480.978 rows=1007 loops=4374)
                      ->  Result  (cost=500.00..500.06 rows=1 width=73) (actual time=0.002..0.002 rows=1 loops=4374)
                            One-Time Filter: ((r.x <> $10) OR (r.y <> $11))
                            InitPlan 5 (returns $10,$11)
                              ->  CTE Scan on src src_1  (cost=0.00..500.00 rows=5000 width=8) (actual time=0.001..0.001 rows=1 loops=1)
                      ->  Nested Loop  (cost=0.00..2.61 rows=5 width=73) (actual time=0.462..0.463 rows=1 loops=4402786)
                            Join Filter: (matrix_2.m[(r_3.y + r_3.d[2])][(r_3.x + r_3.d[1])] IS NOT NULL)
                            Rows Removed by Join Filter: 0
                            ->  Nested Loop  (cost=0.00..0.25 rows=1 width=160) (actual time=0.011..0.012 rows=1 loops=4402786)
                                  ->  CTE Scan on dir dir_2  (cost=0.00..0.10 rows=1 width=128) (actual time=0.000..0.000 rows=1 loops=4402786)
                                  ->  CTE Scan on matrix matrix_2  (cost=0.00..0.10 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=4402786)
                            ->  WorkTable Scan on r r_3  (cost=0.00..1.00 rows=5 width=72) (actual time=0.000..0.000 rows=1 loops=4402786)
                                  Filter: (NOT is_cycle)
                                  Rows Removed by Filter: 0
              ->  CTE Scan on r r_1  (cost=0.00..5.10 rows=51 width=1) (actual time=2.589..597.197 rows=1007 loops=4374)
                    Buffers: temp written=22358948
      
время % rows RRbF % loops тип узла таблица индекс узлы tm.wr
1991238.004
75.5
8819794
16899
.2
8815292
Nested Loop
7 9 12 18 19 23 35 36
8
508343.999
19.3
4409476
4375
CTE Scan
r
28 40
2
22358948
65303.963
2.5
4409476
4375
Recursive Union
16 31
2
48469.586
1.8
4407645
4407645
CTE Scan
matrix
8 21 38
3
22560.395
0.9
4376
4376
Aggregate
0 2 29
3
425
8.751
0.0
4375
4375
Result
5 32
2
7.285
0.0
9716
2
Sort
25 27
2
4.864
0.0
4374
Unique
24
3.245
0.0
4858
WindowAgg
26
1.211
0.0
16900
130
Materialize
11
.594
0.0
130
2
1.5
Function Scan
regexp_split_to_table
3
.117
0.0
260
2
Function Scan
generate_subscripts
10 14
2
.003
0.0
4407645
4407645
CTE Scan
dir
13 20 37
3
4407644
4407644
WorkTable Scan
r
22 39
2
-0.002
-0.0
2
2
CTE Scan
src
17 34
2
tooltip