Database Tuning
Database Tuning
Agenda
How Does ArcSDE Work?
Database Tuning (Oracle and SQL)
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Business Table
Contains attributes and a spatial column Spatial column is a key used to relate to the feature and spatial index tables
SHAPE 1 OBJECTID 1 NAME Main St
FID 1
AREA 0
LEN 926.45
POINTS
SP_FID 1
GX 7
GY 12
EMINX 786
EMINY 840
EMAXX 339
EMAXY 374
(S1)
Database Tuning
February 2005
Feature Table
Stores geometry including annotation and CAD features Also stores attributes describing the geometry such as Area and Length
SHAPE 1 OBJECTID 1 NAME Main St
FID 1
AREA 0
LEN 926.45
POINTS
SP_FID 1
GX 7
GY 12
EMINX 786
EMINY 840
EMAXX 339
EMAXY 374
(S1)
Database Tuning Water/Wastewater DB Design Conference February 2005
FID 1
AREA 0
LEN 926.45
POINTS
SP_FID 1
GX 7
GY 12
EMINX 786
EMINY 840
EMAXX 339
EMAXY 374
(S1)
Database Tuning Water/Wastewater DB Design Conference February 2005
2
1 1
SHAPE 1 2 3
FID 1 2
Business table
POINTS . . . . . xy,xy,xy
S34
Feature table stores geometry Spatial index table stores grid tiles and envelopes Tables join on integer Feature ID column
Database Tuning Water/Wastewater DB Design Conference
3
1 2
February 2005
Spatial index
Spatial index is used to improve performance of data retrieval
Balance
Number of features referenced by each tile (features per tiles) Number of tiles referencing each feature (tiles per feature)
Database Tuning
February 2005
Spatial filter
Database Tuning
February 2005
Spatial Index
Spatial index uses the envelope (bounding box) of the features for fast searching
38,68 53,28
49.5,53.6
49,25
32,64
Envelopes for area and line features use min x,y and max x,y coordinates. The envelope for a point is the actual x,y coordinate.
Database Tuning
February 2005
49
Parcels Example
48
73 Grid tiles
Two numbers in indexed columns
74
75
76
77
Shape envelope
Two coordinates (four numbers) in indexed columns
Shape
Many coordinates in binary column A
Database Tuning Water/Wastewater DB Design Conference February 2005
Goal: Avoid reading shapes for entire layer (full table scan) Four stages of elimination
1. 2. 3. 4. FILTER (SELECTION SHAPE) tile envelope shape shape LAYER tile envelope envelope shape
RDBMS ArcSDE server or client
February 2005
Database Tuning
Many rows take longer to search Many tiles referencing one feature inefficient Balance tiles per feature against feature per tile
Water/Wastewater DB Design Conference February 2005
Database Tuning
Database Tuning
February 2005
Use multiple resolutions (multiple grids) for feature classes with highly-variable feature sizes
Database Tuning
February 2005
Database Tuning
February 2005
SHAPE
ID 1 2
Inserting
Deletes table ID
Deleting
Deletes table 3
ID
Name Citrus
ID 2
Deletes table
Adds table
Updating
SHAPE
ID 3 1
ID 2 1
February 2005
Database Tuning
Database Tuning
February 2005
Pyramids
Pyramids can be built for a raster layer when loaded into ArcSDE Multiple resolutions of the raster layer are stored in the database At a zoomed out scale the lower resolution is displayed As the user zooms in to the highest level of detail, the raster as it was originally loaded (its highest resolution) is shown This significantly helps to speed display of raster layers in ArcGIS and ArcIMS
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Network I/O
T1 line connecting a remote office to an ArcSDE database in a headquarters office can be tied up with one ArcGIS desktop performing normal operations
Solution to this is terminal emulation software such as Citrix or Terminal Server
Database Tuning
February 2005
Database Tuning
February 2005
Data file
Log file
Database Tuning
February 2005
File group
Data file
Data file
Log file
Log file
Database Tuning
February 2005
Oracle Basics
Terminology is different than that for SQL Server An Oracle database is made up of many table spaces A table space can be made up of many data files. Also need to be aware of redo log files and control files Table spaces are logical containers for objects such as:
Tables Stored procedures
Roles and users are stored at the database level and not the table space level
Database Tuning
February 2005
DBTune File/Table
Actually exists as a table in the SDE database or table space Contains storage parameters for tables and feature classes Whenever a new feature class is created and data is loaded, the ArcSDE server process reads the DBTune table for information on how to store these new objects There can be different parameters for different layers or data types and these are specified via keywords
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Disk 4 SDE Transaction log Raster table file group Spatial index file group
Database Tuning
February 2005
Disk 4 Redo log Raster table space Spatial index table space Secondary control files
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Optimize Workflow Data Loading Data Maintenance Reconcile/Post/Compress Collect Performance Stats Establish baseline Use for performance validation Database Design Cost of complex data models While Editing Recursive Relationships Feature linked annotation Types of labels
Editing Operations Use of edit cache is CRITICAL Versioning Methodology Reconcile performance costs Using versioning to model history or alternatives Reconcile/post/compress procedures
Other tools
StorageVisitron (available from ArcScripts) Version Manager ArcObjects sample (Developer Kit)
Database Tuning
February 2005
Database Tuning
February 2005
Topology
Integrity: Domains, Subtypes, Relationship classes Multi-User Editing*
Database Tuning
Geodatabase
Scalability*
*ArcSDE Geodatabase
(Enterprise)
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Design
Database Tuning
February 2005
Database Tuning
February 2005
Geodatabase
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Best Practices
The schema design phase of your geodatabase implementation is critical to the ultimate performance of your GIS system. Geodatabases can contain feature datasets, feature classes, relationship classes, geometric networks, topologies, feature-linked annotation, and other specialized abstractions. Careful consideration of the cost, limitations, and true purpose of each of these abstractions is required to avoid creating a geodatabase that may not perform well in either a single- or multi-user environment.
Database Tuning Water/Wastewater DB Design Conference February 2005
Database Tuning
February 2005
Reduce the number of feature classes by creating collections of features within a single feature class
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Simple annotation
Standalone annotation class. Geodatabase data model Fine cartographic placement of annotation with fixed text. No No Simple annotation lets you place fixed text with a high degree of control. Requires more work than labeling; text values cannot be updated automatically if attributes change. Use simple annotation for static text or text describing large or indeterminate areas.
Labels
Text properties, such as font and size, and a labeling field, defined in an ArcMap layer. ArcMap document or layer property
When text values are attribute values that can be placed automatically on the map.
No No Labeling features is a quick and easy way to add descriptive text to your map.
Cons
While labels will not collide with each other, cartographic placement is rough. Use labeling for quickly placing descriptive text, such as addresses or measurements.
Recommendations
Database Tuning
February 2005
Database Tuning
February 2005
ArcSDE
RDBMS
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Database Tuning
February 2005
Administration Tasks
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning
February 2005
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Enforce recovery policy and procedures Automate recovery procedure where practical
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Development Tasks
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Owner: IT or GIS
Database Tuning
February 2005
Owner: IT or GIS
Database Tuning Water/Wastewater DB Design Conference February 2005
Thank you!
Questions?