Oracle Spatial User's Guide and Reference Release 8.1.7 Part Number A85337-01 |
|
This chapter contains descriptions of the tuning functions and procedures shown in Table 16-1.
SDO_TUNE.AVERAGE_MBR (layername, width, height)
Calculates the average minimum bounding rectangle (MBR) for all geometries in a layer.
This function returns the width and height of the average MBR for all geometries in a layer.
This function calculates the average MBR by keeping track of the maximum and minimum X and Y values for all geometries in a layer.
SDO_TUNE.ESTIMATE_INDEX_PERFORMANCE (layername, sample_ratio, tiling_level,
num_tiles, window_layer, window_gid, tiling_time, filter_time, query_time)
Estimates the spatial index performance such as query selectivity and window query time for a layer.
This function returns a number between 0.0 and 1.0 representing estimated spatial index selectivity. It also returns the estimated tiling time, filter time, and query time.
Data type for these variables is NUMBER.
SDO_TUNE.ESTIMATE_TILING_LEVEL (layername, maxtiles, type_of_estimate)
Estimates the appropriate tiling level to use when indexing with fixed-size tiles.
This function returns an integer representing the level to use when creating a spatial index for the specified layer.
The SDO_ADMIN.POPULATE_INDEX and SDO_ADMIN.UPDATE_INDEX procedures are used to create or update the spatial index using fixed-size or hybrid indexing. Store the value returned by the SDO_TUNE.ESTIMATE_TILING_LEVEL
function in the SDO_LEVEL column of the <layername>_SDOLAYER table before building the spatial index.
The maxtiles parameter specifies the maximum number of tiles that should be used to define a grid covering the rectangular extent of interest. This extent could be:
SDO_TUNE.EXTENT_OF
procedure)
The code shown in Example 16-1 generates a recommendation based on the extent of the defined coordinate system (-90 to +90 latitude and -180 to +180 longitude). This example returns a level whose tiles are not smaller than one-degree cells.
set serveroutput on declare tiling_level integer; begin tiling_level := mdsys.sdo_tune.estimate_tiling_level('WORLD_CITIES',
360*180, 'LAYER_EXTENT'); dbms_output.put_line('VALUE is '|| tiling_level); end;
For most applications, however, it is more effective to call the SDO_TUNE.ESTIMATE_TILING_LEVEL function using the ALL_GID_EXTENT estimate type with a maxtiles value of 10,000. In Example 16-2, assume the data set consists of block groups for San Francisco and that the <layername>_SDODIM table defines the extent to be one that covers all of California. Because the data set is localized to a small subregion of this extent, ALL_GID_EXTENT is the appropriate estimate type. The recommended tiling level in this case will be such that at most, 10,000 tiles will be required to completely cover the extent of San Francisco block groups.
set serveroutput on declare tiling_level integer; begin tiling_level:= mdsys.sdo_tune.estimate_tiling_level('SF_BLOCK_GROUPS',
10000, 'ALL_GID_EXTENT'); dbms_output.put_line('VALUE is' ,|| tiling_level); end;
The third type of estimate helps determine the tiling level that should be used such that on average, the maxtiles parameter defines the number of tiles to cover the extent of a single geometry in the layer. This estimate type requires the most computation of the three because the bounding rectangle of every geometry is used in calculating the average extent. In Example 16-3, eight tiles on average are used to cover any block group in San Francisco.
set serveroutput on declare tiling_level integer; begin tiling_level := mdsys.sdo_tune.estimate_tiling_level('SF_BLOCK_GROUPS', 8,
'AVG_GID_EXTENT'); dbms_output.put_line('Tiling level value is ' || tiling_level); end;
SDO_TUNE.ESTIMATE_TILING_TIME (layername, sample_ratio, tiling_level, num_tiles)
Returns the estimated time to tessellate a layer.
This function returns the estimated tiling time in seconds. A return of 0 indicates an error.
Data type is NUMBER.
None.
SDO_TUNE.EXTENT_OF (layername, min_X, max_X, min_Y, max_Y)
Determines the extent of all geometries in a layer.
This function returns the coordinates of the minimum bounding rectangle for all geometric data in a layer.
Data type is NUMBER for the four return values.
None.
SDO_TUNE.HISTOGRAM_ANALYSIS (layername, result_table, type_of_histogram,
max_value, intervals)
Generates statistical histograms based on a layer.
This procedure populates the result table with statistical histograms for a spatial layer.
You must create the result table before calling this procedure. The table has the following format:
CREATE TABLE histogram (value NUMBER, count NUMBER);
The following types of histograms are available:
SDO_TUNE.MIX_INFO (layername)
Provides the number of geometries of each type stored in the layer.
layername |
Specifies the name of the spatial data set layer to examine. |
This function calculates geometry type information for the layer. It returns the number of geometries of different type, as well as the percentages of points, line strings, polygons, and complex geometries.
None.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|