gseidx command

Use the gseidx command to invoke the Index Advisor for spatial grid indexes.

Syntax

Read syntax diagramSkip visual syntax diagramgseidx CONNECT TOdatabase_name USERuseridUSINGpassword GET GEOMETRYSTATISTICSexisting-indexsimulated-indexANALYZEnumberROWSPERCENT1ONLYSHOWMINIMUM BOUNDING RECTANGLEHISTOGRAMWITHnBUCKETSADVISEGRIDCELLSIZES
existing-index
Read syntax diagramSkip visual syntax diagramFOR INDEX index-schema. index-nameDETAIL
simulated-index
Read syntax diagramSkip visual syntax diagramFOR COLUMN table-schema. table-name(column-name) USING GRIDCELLSIZES(,grid-size2)
Notes:
  • 1 Instead of the PERCENT keyword, you can specify a percentage sign (%).
  • 2 You can specify cell sizes for one, two, or three grid levels.

Parameters

database_name
The name of the database in which the spatial table resides.
userid
The user ID that has DATAACCESS authority on the database in which the index or table resides or SELECT authority on the table. If you log on to the Db2® command environment with the user ID of the database owner, you do not need to specify userid and password in the gseidx command.
password
Password for the user ID.
existing-index
References an existing index to gather statistics on.
index-schema
Name of the schema that includes the existing index.
index-name
Unqualified name of the existing index.
DETAIL
Shows the following information about each grid level:
  • The size of the grid cells
  • The number of geometries indexed
  • The number of index entries
  • The number of grid cells that contain geometries
  • The average number of index entries per geometry
  • The average number of geometries per grid cell
  • The number of geometries in the cell that contains the most geometries
  • The number of geometries in the cell that contains the fewest geometries
simulated-index
References a table column and a simulated index for this column.
table-schema
Name of the schema that includes the table with the column for which the simulated index is intended.
table-name
Unqualified name of the table with the column for which the simulated index is intended.
column-name
Unqualified name of the table column for which the simulated index is intended.
grid-size
Sizes of the cells in each grid level (finest level, middle level, and coarsest level) of a simulated index. You must specify a cell size for at least one level. If you do not want to include a level, either do not specify a grid cell size for it or specify a grid cell size of zero (0.0) for it.

When you specify the grid-size parameter, the Index Adviser returns the same kinds of statistics that it returns when you include the DETAIL keyword in the existing-index clause.

ANALYZE number ROWS | PERCENT ONLY
Specify the approximate quantity or approximate percentage of the rows used to gathers statistics on data. If your table has more than one million rows, use the ANALYZE clause to gather statistics for a data subset so that you can have a reasonable processing time.
SHOW MINIMUM BOUNDING RECTANGLE HISTOGRAM
Displays a chart that shows the sizes of the geometries' minimum bounding rectangles (MBRs) and the number of geometries whose MBRs are of the same size.
WITH n BUCKETS
Specifies to the number of groupings for the MBRs of all analyzed geometries. Small MBRs are grouped together with other small geometries. The larger MBRs are grouped with other larger geometries.

If you do not specify this parameter or specify 0 buckets, the Index Advisor displays logarithmic bucket sizes. For example, the MBR sizes might be logarithmic values such as 1.0, 2.0, 3.0,... 10.0, 20.0, 30.0,... 100.0, 200.0, 300.0,...

If you specify a number of buckets greater than 0, the Index Advisor displays equal-sized values. For example, the MBR sizes might be equal-sized values such as 8.0, 16.0, 24.0,... 320.0, 328.0, 334.0.

The default is to use logarithmic-sized buckets.

ADVISE GRID CELL SIZES
Computes close-to-optimal grid cell sizes.

Usage note

If you enter the gseidx command from an operating system prompt, you must type the entire command on a single line.

Example

The following example is a request to return detailed information about an existing grid index whose name is COUNTIES_SHAPE_IDX and suggest appropriate grid index sizes:

gseidx CONNECT TO mydb USER user ID USING password GET GEOMETRY 
STATISTICS FOR INDEX userID.counties_shape_idx DETAIL ADVISE