| 25 | Regular tiling partitions the source array into a regular grid of fixed-domain tiles. This means that the array domain must be divisible by the tile domain, allowing to use a [#Regularcomputedindex regular computed index], which is faster then indexes for non-regular tile layouts. |
| 26 | |
| 27 | For example, consider inserting an array of domain [0:299,0:299] (size 300x300), and splitting into tiles of domain [0:99,0:49] (size 100x50): |
| 28 | {{{ |
| 29 | insert into test |
| 30 | values |
| 31 | marray x in [0:299,0:299] values 1c |
| 32 | tiling regular [0:99,0:49] |
| 33 | index rc_index |
| 34 | }}} |
| 35 | |
| 36 | The resulting layout of the array as stored in the database is shown on the below image. |
| 37 | |
| 38 | [[Image(tiling_regular_[0-99,0-49]_index_rc_index.png)]] |
| 39 | |
| 42 | |
| 43 | Aligned tiling allows to flexibly describe the format that tiles should have. The tile configuration is expressed with a multidimensional interval of same dimensionality as the source array. Its extents along each dimension are interpreted relative to the others. |
| 44 | |
| 45 | For example, if tile configuration is [ 0:29, 0:133 ], tiles will be 2-D arrays with the first dimension of size X and second dimension of size (134 / 30) * X. The specified tile size will determine the actual domain of the result tiles. E.g. below we use tile size 10000, which produces most tiles of domain [ 0:46, 0:210 ]: |
| 46 | |
| 47 | {{{ |
| 48 | insert into test |
| 49 | values |
| 50 | marray x in [0:299,0:299] values 1c |
| 51 | tiling aligned [0:29,0:133] |
| 52 | tile size 10000 |
| 53 | }}} |
| 54 | Note that at the edge tile domain will be automatically aligned to the global array bound. No index is specified as by default the [#Rtree R+ tree index] is used, which is perfectly suitable for this tiling scheme. |
| 55 | |
| 56 | [[Image(tiling_aligned_[0-29,0-133]_tile_size_10000.png)]] |
| 57 | |
| 58 | Tile configuration with non-fixed limits indicates a preference to have tiles span along some directions, e.g. the below results in tiles as large as possible along the first dimension (tile domains [ 0:299, 0:43 ]): |
| 59 | {{{ |
| 60 | insert into test |
| 61 | values |
| 62 | marray x in [0:299,0:299] values 1c |
| 63 | tiling aligned [0:*,0:43] |
| 64 | tile size 40000 |
| 65 | }}} |
| 66 | |
| 67 | [[Image(tiling_aligned_[0-*,0-43]_tile_size_40000.png)]] |
| 68 | |
| 69 | If fixed tiles are required, regular tiling can be imitated by setting tile size to match the tile configuration. For example, if the tile configuration is [ 0:29, 0:39, 0:59] and cell size is 2, then the tile size should be set to 144000. This will also result in more efficient computation of the tiling since the given tile configuration is used unchanged if `90% * tile_size < size of tile_config < tile_size` (i.e., no computation is necessary). This applies equally to tile configurations with non-fixed limits. |
| 70 | {{{ |
| 71 | insert into test |
| 72 | values |
| 73 | marray x in [0:299,0:299] values 1c |
| 74 | tiling aligned [0:29,0:133] |
| 75 | tile size 4020 |
| 76 | }}} |
| 77 | The difference to regular tiling is that the tiles at the borders will be adjusted to fit in the domain in this case. |
| 78 | |
| 79 | [[Image(tiling_aligned_[0-*,0-43]_tile_size_40000.png)]] |
| 84 | With directional tiling we can model the tiling scheme according to a given direction (dimension) decomposition. Along each direction we set the preference for tile sizes along that direction, either by directly listing the limits for each tile (starting from the low, ending with the high dimension limit), or by setting a preference (with a '*') so that the tile is as large as possible in that direction. |
| 85 | |
| 86 | The format of the tiling configuration for directional tiling consists of N decomposition vectors (for an N-D array): [dec1],[dec2],..,[decN]. The decX decomposition vector is a list of tile limits, e.g., 0,100,200,.. or a '*'. |
| 87 | |
| 88 | The below demonstrates how to set tile limits for both directions, 0,100,299 in the first and 0,50,80,100,200,299 in the second: |
| 89 | {{{ |
| 90 | insert into test |
| 91 | values |
| 92 | marray x in [0:299,0:299] values 1c |
| 93 | tiling directional [0,100,299],[0,50,80,100,200,299] |
| 94 | }}} |
| 95 | [[Image(tiling_directional_[0,100,299],[0,50,80,100,200,299].png)]] |
| 96 | |
| 97 | This gives a preference to the second direction, i.e. tiles will be as large as possible in this direction: |
| 98 | {{{ |
| 99 | insert into test |
| 100 | values |
| 101 | marray x in [0:299,0:299] values 1c |
| 102 | tiling directional [0,100,299],[*] |
| 103 | }}} |
| 104 | [[Image(tiling_directional_[0,100,299],[*].png)]] |
| 105 | |
| 106 | Finally, specifying a with subtiling allows to respect the tile size and break between the given limits if the tile configuration in order to match tiles to the given tile size: |
| 107 | {{{ |
| 108 | insert into test |
| 109 | values |
| 110 | marray x in [0:299,0:299] values 1c |
| 111 | tiling directional [0,100,200,299],[*] |
| 112 | with subtiling |
| 113 | tile size 30000 |
| 114 | }}} |
| 115 | [[Image(tiling_directional_[0,100,200,299],[*]_with_subtiling_tile_size_30000.png)]] |
| 116 | |
| 119 | |
| 120 | This tiling scheme allows optimizing access when it is known that some areas of the array are accessed particularly often. These areas are listed as tile domains in the tile configuration, indicating the tiles that must be creating. |
| 121 | {{{ |
| 122 | insert into test |
| 123 | values |
| 124 | marray x in [0:299,0:299] values 1c |
| 125 | tiling area of interest [100:299,0:199],[0:49,0:49] |
| 126 | }}} |
| 127 | [[Image(tiling_area_of_interest_[100-299,0-199],[0-49,0-49].png)]] |
| 128 | |
| 129 | Without specifying a tile size, the tiles (besides those specified in the tiling configuration) will be as large as possible. Specifying a tile size will limit those other tiles, but it may also limit the tiles for the interesting areas. Several tile size limitation options allow to have a more precise control over this: |
| 130 | * ''NO_LIMIT'' |
| 131 | * ''REGROUP'' |
| 132 | * ''SUB_TILING'' |
| 133 | * ''REGROUP_AND_SUBTILING'' |