ws sde spat_indxslides

19
Understanding the ArcSDE Understanding the ArcSDE Spatial Index Spatial Index Presenter: Shannon Shields ESRI Redlands, California

Upload: bangalore-techie

Post on 13-Feb-2017

90 views

Category:

Technology


0 download

TRANSCRIPT

Understanding the ArcSDE Understanding the ArcSDE Spatial IndexSpatial Index

Presenter: Shannon Shields ESRI Redlands, California

Copyright © 2002 ESRI

Seminar overviewSeminar overviewTopics include

What is a spatial index?How does the spatial index work?Choosing a spatial index sizeTuning the spatial index

FormatEach topic followed by a brief question and answer periodExcerpt of the questions and their answers available in associated Web Workshop

Copyright © 2002 ESRI

What is an index?What is an index?Search for a value without reading entire column

Efficient queriesIndex types

A separate object (e.g., book index)A sorted table (e.g., phone book, encyclopedia)

Sort orderNumeric or alphabetic

RDBMS understands distribution of dataIndex statistics

Copyright © 2002 ESRI

What is a spatial index?What is a spatial index?Search for a shape without reading entire column

Efficient spatial searchingSpatial index uses the envelope (bounding box) of the features for fast searching

49,25

53,28

49,53

38,68

32,64

Copyright © 2002 ESRI

Different types of spatial indexesDifferent types of spatial indexesGrid Tile index

DB2, Oracle, SQL ServerSeparate table that is searched with range queriesUser controls index size

R-Tree indexInformix, Oracle SpatialIndex built on spatial columnRDBMS manages index

Copyright © 2002 ESRI

Topic Review and Q & ATopic Review and Q & AWhat an index is What a spatial index is Different types of spatial indexes

Copyright © 2002 ESRI

Grid tile spatial index architecture Grid tile spatial index architecture

Grid tilesTwo numbers in indexed columns

75 76 77

48

49Shape envelope

Two coordinates (four numbers) in indexed columns

75 76 77

48

49

Copyright © 2002 ESRI

Grid tile spatial index architecture cont.Grid tile spatial index architecture cont.

GeometryID of coordinates in feature table

Spatial index table (S-table)Seven columnsSingle covering index on all columnsFirst stop for spatial queries

75 76 77

48

49

Copyright © 2002 ESRI

How the grid tile spatial index worksHow the grid tile spatial index works

Goal: Avoid reading features for entire feature class

Four stages of elimination

Parcelsfeatureclass

Spatialqueryfilter

Copyright © 2002 ESRI

Primary filter: RDBMSPrimary filter: RDBMS

1. Grid tileon grid tile

2. Envelope on envelope

Copyright © 2002 ESRI

Secondary filter: ArcSDE server or clientSecondary filter: ArcSDE server or client

3. Filter shapeon featureclass envelope

4. Filter shapeon feature classshape

Copyright © 2002 ESRI

Topic Review and Q & ATopic Review and Q & ASpatial index table schemaHow the spatial index works

Primary filterSecondary filter

Copyright © 2002 ESRI

ArcGIS spatial index defaultsArcGIS spatial index defaultsNew feature class

1000Import existing data

Based on sampleAlgorithm does not check every feature

PointsSmaller for dense distribution

Lines, polygons, multipointDepends on “squareness” of feature envelopes

Copyright © 2002 ESRI

Goal for setting spatial index sizeGoal for setting spatial index sizeBalance table size and index selectivity to reduce I/O

Inversely relatedControl ratio with grid tile size

Large tilesSmall indexLow selectivity

Small tilesLarge indexHigh selectivity

Copyright © 2002 ESRI

Choosing a spatial index sizeChoosing a spatial index sizeMultipoint, line, polygon

Start with 3x average feature envelopePoints are different

Envelope has no area

S-table has 3 entries S-table has 30 entries

Copyright © 2002 ESRI

Finding 3x the average feature envelopeFinding 3x the average feature envelopeRDBMSselectavg(((emaxx - eminx)+(emaxy - eminy))/2)*3from f<#>

ArcView 3.x(([Shape].ReturnExtent.GetWidth +[Shape].ReturnExtent.GetHeight])/2)*3

ArcObjects macro

Copyright © 2002 ESRI

Reporting spatial index statisticsReporting spatial index statisticsReport statistics from the spatial index tablesdelayer –o si_stats

RDBMSTrace utilities (SQL Trace, SQL Profiler)Time and I/O statistics

Examine distribution of features per tile (RDBMS)Select count(*), gx, gyfrom s<#>group by gx, gyorder by 1 desc

Copyright © 2002 ESRI

Interpreting spatial index statisticsInterpreting spatial index statisticsSdelayer –o si_stats outputGrids/Feature RatioAvg. Features per Grid Max. Features per Grid% of Features Wholly Inside 1 Grid

Record Count By Group histogramPercentage of features in four or fewer tilesPercentage of feature in more than four tilesAvoid feature envelopes that are larger than a tile

Copyright © 2002 ESRI

Topic Review and Q & ATopic Review and Q & AArcGIS spatial index defaultsChoosing a spatial index sizeReporting spatial index statisticsInterpreting spatial index statistics