Oracle8 Spatial Cartridge User's Guide and Reference
Release 8.0.4

A53264-02

Library

Product

Contents

Index

Prev Next

6
Tuning Functions

This chapter contains descriptions of the tuning functions and procedures shown in Table 6-1

Table 6-1 Tuning Functions and Procedures:
Function/Procedure   Description  

SDO_TUNE.ESTIMATE_TILING_LEVEL

 

Determines an appropriate tiling level for creating fixed-size index tiles.

 

SDO_TUNE.EXTENT_OF

 

Determines the minimum-bounding rectangle of the data in a layer.

 


SDO_TUNE.ESTIMATE_TILING_LEVEL

Purpose

This function estimates the appropriate tiling level to use when indexing with fixed-size tiles.

Syntax

SDO_TUNE.ESTIMATE_TILING_LEVEL (layername, maxtiles, type_of_estimate)

Keywords and Parameters

layername

 

Specifies the name of the dataset layer to examine.
Data type is VARCHAR2.

 

maxtiles

 

Specifies the maximum number of tiles that can be used to index the rectangle defined by the type_of_estimate parameter.
Data type is INTEGER.

 

type_of_estimate

 

Indicates by keyword one of three different models. Specify the type of estimate with one of the following keywords:

LAYER_EXTENT -- Use the rectangle defined by your coordinate system. ALL_GID_EXTENT -- Use the minimum-bounding rectangle that encompasses all the geometric objects within the layer.AVG_GID_EXTENT -- Use a rectangle representing the average size of the individual geometries within the layer. This option performs the most analysis of the three types.  

Returns

The function returns an integer representing the level to use when creating a spatial index for the specified layer.

Usage Notes

The SDO_ADMIN.POPULATE_INDEX() and SDO_ADMIN.UPDATE_INDEX() procedures are used to create or update the spatial index using fixed-size or variable-sized tiles. Store the value returned by the SDO_TUNE.ESTIMATE_TILING_LEVEL() function in the SDO_LEVEL column of the <layername>_SDOLAYER table prior to building the spatial index.

The maxtiles parameter specifies the maximum number of tiles that should be used to define a grid covering the rctangular extend of interest. This extent could be:

The code shown in Example 6-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.

Example 6-1 Recommended Tile Level for One-Degree Lat/Lon 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 many applications, however, it is more effective to call the SDO_TUNE.ESTIMATE_TILING_LEVEL() function using the ALL_GID_EXTENT estimate type. In Example 6-2, assume the dataset 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 dataset 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.

Example 6-2 Recommended Tile Level Based on the GIDs of All Geometries

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 box of every geometry is used in calculating the average extent. In Example 6-3, eight tiles on average are used to cover any block group in San Francisco.

Example 6-3 Recommended Tile Level Based on Average Extent of All Geometries

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;

Related Topics


SDO_TUNE.EXTENT_OF

Purpose

This procedure determines the extent of all geometries in a layer.

Syntax

SDO_TUNE.EXTENT_OF (layername, min_X, max_X, min_Y, max_Y)

Keywords and Parameters

layername

 

Specifies the name of the dataset layer. The layername is used to construct the name of the geometry and spatial index tables.
Data type is VARCHAR2.

 

min_X

 

Minimum X value of the bounding rectangle. Data type is number.

 

max_X

 

Maximum X value of the bounding rectangle. Data type is number.

 

min_Y

 

Minimum Y value of the bounding rectangle. Data type is number.

 

max_Y

 

Maximum Y value of the bounding rectangle. Data type is number.

 

Returns

This procedure returns the coordinates of the minimum-bounding rectangle for all geometric data in a layer. The data type is NUMBER for the four return values.

Usage Notes

None

Related Topics




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index