2025-01-17 08:29:39.345
710d7592ca4986e8bcff133b89059673
 0.873 ms
#17 VS |
tilemap |  piechart
timetilemap
#
node, ms
tree, ms
rows
RRbF
loops
AggregateNested LoopMemoizeAggregateRecursive UnionNested LoopValues Scan on "*VALUES*"SortCTE Scan on r
29.272122223
итоговые результаты
0
.036
29.272
1
Aggregate
1
  CTE matrix
2
.482
.615
1
   ->  Aggregate
3
.133
50
2
3.8%
        ->  Function Scan on regexp_split_to_table line
4
.151
29.236
256
  ->  Nested Loop
5
.346
1.437
256
2244
89.8%
       ->  Nested Loop
6
.011
.641
50
            ->  Nested Loop
7
.003
.618
1
                 ->  CTE Scan on matrix
8
.012
50
                 ->  Function Scan on generate_subscripts x
9
.442
.450
2500
50
            ->  Memoize
10
.008
50
                 ->  Function Scan on generate_subscripts y
11
1.024
27.648
256
256
       ->  Aggregate
12
            CTE r
13
1.792
17.152
6656
256
             ->  Recursive Union
14
256
256
                  ->  Result
15
2.042
15.360
7680
2560
                  ->  Nested Loop
16
7680
2560
                       ->  WorkTable Scan on r r_1
17
13.318
6659
19977
75.0%
6659
                       ->  Values Scan on "*VALUES*"
18
6.912
26.624
6656
256
            ->  Sort
19
2.560
19.712
6656
256
                 ->  CTE Scan on r
.270
 
Planning Time
.211
29.483
Execution Time
r r_1r r_12560"*VALUES*""*VALUES*"6659regexp_split_to_table lineregexp_split_to_table lineResultResult256Nested LoopNested Loop2560AggregateAggregatematrixRecursive UnionRecursive Union256rmatrixmatrixgenerate_subscripts xgenerate_subscripts xgenerate_subscripts ygenerate_subscripts yrr256Nested LoopNested LoopMemoizeMemoize50SortSort256Nested LoopNested LoopAggregateAggregate256Nested LoopNested LoopAggregateAggregate
Aggregate (actual time=29.270..29.272 rows=1 loops=1)
  CTE matrix
    ->  Aggregate (actual time=0.614..0.615 rows=1 loops=1)
          ->  Function Scan on regexp_split_to_table line (actual time=0.116..0.133 rows=50 loops=1)
                Filter: (btrim(line) <> ''::text)
                Rows Removed by Filter: 2
  ->  Nested Loop (actual time=0.864..29.236 rows=256 loops=1)
        ->  Nested Loop (actual time=0.641..1.437 rows=256 loops=1)
              Join Filter: (matrix.m[y.y][x.x] = 0)
              Rows Removed by Join Filter: 2244
              ->  Nested Loop (actual time=0.624..0.641 rows=50 loops=1)
                    ->  CTE Scan on matrix (actual time=0.618..0.618 rows=1 loops=1)
                    ->  Function Scan on generate_subscripts x (actual time=0.005..0.012 rows=50 loops=1)
              ->  Memoize (actual time=0.007..0.009 rows=50 loops=50)
                    Cache Key: matrix.m
                    Cache Mode: binary
                    Hits: 49  Misses: 1  Evictions: 0  Overflows: 0  Memory Usage: 12kB
                    ->  Function Scan on generate_subscripts y (actual time=0.005..0.008 rows=50 loops=1)
        ->  Aggregate (actual time=0.108..0.108 rows=1 loops=256)
              CTE r
                ->  Recursive Union (actual time=0.000..0.067 rows=26 loops=256)
                      ->  Result (actual time=0.000..0.000 rows=1 loops=256)
                      ->  Nested Loop (actual time=0.002..0.006 rows=3 loops=2560)
                            ->  WorkTable Scan on r r_1 (actual time=0.000..0.000 rows=3 loops=2560)
                            ->  Values Scan on "*VALUES*" (actual time=0.001..0.002 rows=1 loops=6659)
                                  Filter: ((r_1.h + 1) = (matrix.m)[column2][column1])
                                  Rows Removed by Filter: 3
              ->  Sort (actual time=0.102..0.104 rows=26 loops=256)
                    Sort Key: (ROW(r.x, r.y))
                    Sort Method: quicksort  Memory: 28kB
                    ->  CTE Scan on r (actual time=0.001..0.077 rows=26 loops=256)
Planning Time: 0.270 ms
Execution Time: 29.483 ms
Process
  CTE matrix
    ->  Process
          ->  Scan Function regexp_split_to_table
  ->  Join
        ->  Process
              CTE r
                ->  Recursive Union
                      ->  Result
                      ->  Join
                            ->  Scan CTE r
                            ->  Scan Values "*VALUES*"
              ->  Scan CTE r
        ->  Scan CTE matrix
        ->  Scan Function generate_subscripts
        ->  Scan Function generate_subscripts
"Aggregate (actual time=29.270..29.272 rows=1 loops=1)"
"  CTE matrix"
"    ->  Aggregate (actual time=0.614..0.615 rows=1 loops=1)"
"          ->  Function Scan on regexp_split_to_table line (actual time=0.116..0.133 rows=50 loops=1)"
"                Filter: (btrim(line) <> ''::text)"
"                Rows Removed by Filter: 2"
"  ->  Nested Loop (actual time=0.864..29.236 rows=256 loops=1)"
"        ->  Nested Loop (actual time=0.641..1.437 rows=256 loops=1)"
"              Join Filter: (matrix.m[y.y][x.x] = 0)"
"              Rows Removed by Join Filter: 2244"
"              ->  Nested Loop (actual time=0.624..0.641 rows=50 loops=1)"
"                    ->  CTE Scan on matrix (actual time=0.618..0.618 rows=1 loops=1)"
"                    ->  Function Scan on generate_subscripts x (actual time=0.005..0.012 rows=50 loops=1)"
"              ->  Memoize (actual time=0.007..0.009 rows=50 loops=50)"
"                    Cache Key: matrix.m"
"                    Cache Mode: binary"
"                    Hits: 49  Misses: 1  Evictions: 0  Overflows: 0  Memory Usage: 12kB"
"                    ->  Function Scan on generate_subscripts y (actual time=0.005..0.008 rows=50 loops=1)"
"        ->  Aggregate (actual time=0.108..0.108 rows=1 loops=256)"
"              CTE r"
"                ->  Recursive Union (actual time=0.000..0.067 rows=26 loops=256)"
"                      ->  Result (actual time=0.000..0.000 rows=1 loops=256)"
"                      ->  Nested Loop (actual time=0.002..0.006 rows=3 loops=2560)"
"                            ->  WorkTable Scan on r r_1 (actual time=0.000..0.000 rows=3 loops=2560)"
"                            ->  Values Scan on "*VALUES*" (actual time=0.001..0.002 rows=1 loops=6659)"
"                                  Filter: ((r_1.h + 1) = (matrix.m)[column2][column1])"
"                                  Rows Removed by Filter: 3"
"              ->  Sort (actual time=0.102..0.104 rows=26 loops=256)"
"                    Sort Key: (ROW(r.x, r.y))"
"                    Sort Method: quicksort  Memory: 28kB"
"                    ->  CTE Scan on r (actual time=0.001..0.077 rows=26 loops=256)"
"Planning Time: 0.270 ms"
"Execution Time: 29.483 ms"
время % rows RRbF % loops тип узла таблица индекс узлы
13.318
45.5
6659
19977
75.0
6659
Values Scan
*VALUES*
17
6.912
23.6
6656
256
Sort
18
2.560
8.7
6656
256
CTE Scan
r
19
2.550
8.7
8242
2244
21.4
2563
Nested Loop
4 5 6 15
4
1.792
6.1
6656
256
Recursive Union
13
1.542
5.3
258
258
Aggregate
0 2 11
3
.442
1.5
2500
50
Memoize
9
.133
0.5
50
2
3.8
Function Scan
regexp_split_to_table
3
.020
0.1
100
2
Function Scan
generate_subscripts
8 10
2
.003
0.0
1
CTE Scan
matrix
7
256
256
Result
14
7680
2560
WorkTable Scan
r
16
tooltip