Upcoming SlideShare
×

Optimizing spatial database

2,718 views
2,468 views

Published on

3 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
2,718
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
0
0
Likes
3
Embeds 0
No embeds

No notes for slide
• Traditional VS SpatialSpatial objects: examples, location or shape, river, forest, border
• Point data is a point which is completely characterized by its location in a multidimensional space.Regional Data
• the grid is a specific area which is divided into a series of contiguous cells, that can have unique identifiers, so they can be used as spatial indexes.Such grids exist in a variety of form s
• is used for data structures to map multidimensional data in one dimension. it can be used as binary search trees, B trees, lists or hash tables.
• UB trees are balanced trees for efficient storageand query of multidimensional data.They are actually B + trees (with informationonly in the leaves), with records stored as inZ-order.
• Kd (k-dimensional) Tree is a space partitioning data structure for organizing points in a k-dimensional space. Kd-tree is used in applications involving multi-dimensional search key.
• m-tree index can be used for efficient handling of complex object queries using an arbitrary metric.As in any Tree-based data structure, the M-Tree is composed of Nodes and Leaves. In each node there is a data object that identifies it uniquely and a pointer to a sub-tree where its children reside. Every leaf has several data objects. For each node there is a radius r that defines a Ball in the desired metric space. Thus, every node n and leaf l residing in a particular node N is at most distance r from N, and every node n and leaf l with node parent N keep the distance from it.
• the surface is replaced by volume and the perimeter of a polygon or hyper-polygon is defined by the sum of its extensions in different sizes or by the sum of volumes of the polygon’s sides.
• The number of times,in which the decomposition is made, can befixed in advance or may be governed by theproperties of input data
• (surfaces, points, lines or curves),
• Root node represents the entire imageregion. If in a region there are pixels whichare not all 0 or 1, the region will divide in thesub-regions. Each leaf node represents ablock of pixels that are either all 0 or all 1.
• 100 miles radius of midtown Manhattan, New York,
• Create Table.Insert Data.Modify MetaData.Create Index.Query 1: Intersection.Query 2: Area.Query 3: Distance.Query 4: Spatial relations.
• Optimizing spatial database

1. 1. OPTIMIZING SPATIALDATABASESBY ANDA VELICANU, ŞTEFAN OLARUPresented By: Ishraq Fataftah
2. 2. Agenda Introduction. Spatial Indexing Structure.  R-Tree Index.  Quadtree Index. Comparing Spatial Indexes. Oracle Examples. Conclusion.
3. 3. Introduction City Map
4. 4. Introduction Cont. Spatial Objects: Consists of lines, surfaces, volumes and higher dimension objects that are used in applications of computer-aided design, cartography, geographic information systems. Spatial Data: The values of the objects’ spatial attributes (length, configuration, perimeter, area, volume, etc.)
5. 5. Introduction Cont. Spatial Databases: is a collection of spatial and non-spatial data that is interrelated, of data descriptions and links between data. It offers additional functions that allow processing spatial data types.  Geometry.  Geography.
6. 6. Introduction Cont. Optimizing spatial databases means optimizing the queries, which requires less time spent by running the queries before receiving an answer.
7. 7. Spatial Indexes Indexing spatial data: a mechanism to decrease the number of searches (optimize spatial queries). A spatial index is used to locate objects in the same area of data or from different locations. Spatial indexes include:  Grid index.  Z-order.  Quadtree, Octree.  UB-tree,  R-tree.  kd-tree,  M-tree.
8. 8. Spatial Indexes: Grid Index
9. 9. Spatial Indexes: Z-Order
10. 10. Spatial Indexes:UB Tree
11. 11. Spatial Indexes: Kd tree
12. 12. Spatial Indexes: m tree
13. 13. Spatial Indexes: R-Tree
14. 14. Spatial Indexes: R-Tree
15. 15. Spatial Indexes: R-Tree Objects (geometric shapes, lines or points) are grouped using a MBR (Minimum Bounding Rectangle). Objects are added to an MBR with an index, leading to the smallest distance possible. Queries and updates get the R-tree’s root and browses down to the leaves.
16. 16. Spatial Indexes: R-Tree Criteria that may affect the response time of an R-tree configuration for the two-dimensional case,  The MBR area  The MBR perimeter  The distance between bounding rectangles  Using the storage space
17. 17. Spatial Indexes: R-Tree Building an R-tree index depends on two characteristics:  The way the objects are inserted in the tree.  Incremental with dynamic data.  Batch with known data.  Dimensionality  Linear.  Dimensional.
18. 18. Spatial Indexes: R-Tree Spatial object: Contour (outline) of the area around the building(s). Minimum bounding region (MBR) of the object. 18
19. 19. Spatial Indexes: Quadtree This type of indexing starts is a tree whose inner nodes have up to four children. Used to partition a two-dimensional space by dividing it into four identically shaped regions.  Bein equal parts on each level.  Depend on incoming data.
20. 20. Spatial Indexes: Quadtree Types of Quadtree indexes are classified by:  The type of data that is represented  The independence of the tree’s shape on the order in which data is processed.  Variability of the tree obtained from data processing.
21. 21. Spatial Indexes: Quadtree Region Quadtree:  Decomposing the region into four equal quadrants.  Each node in the tree has either four children or none (leaf node).  A Region tree with four sizes and a depth of n can be used for representing an image of 2n × 2n pixels, each pixel’s value is 0 or 1.
22. 22. Spatial Indexes: Quadtree Point Quadtree:  Based on binary trees used to represent two- dimensional point data type.  Complex nodes that contain more than two pointers (left, right) and information.  4 pointers: NW, NE, SW and SE,  The key represented in x, y coordinates,  Information.  The tree shape depends on the order in which data is processed.
23. 23. Spatial Indexes: Quadtree Edge Quadtree:  Used mostly to store lines and not points.  Curves are approximated by subdividing the cells in a very fine resolution.  Result as very unbalanced trees.  Rarely used.
24. 24. Spatial Indexes: Quadtree Common characteristics between all Quadtree types:  The space is split into cells;  Each cell or group of cells has a maximum capacity, and when it is reached the group of cells splits;  The tree’s dimension and shape depend (strictly or not) on how the new data is inserted.
25. 25. Comparing Spatial Indexing Quadtrees  use interior spaces for queries and data geometries.  Pieces of space are labeled as interior or border, considering whether or not they are within the geometry.  Inner surfaces arising from the execution of a query are also identified R-tree uses only inner queries.
26. 26. Comparing Spatial Indexing
27. 27. Comparing Spatial Indexing Quadtree has its advantages in terms of more complex types of queries. Basic spatial operations are performed much faster using an R-tree indexing type.
28. 28. Oracle Spatial Examples Oracle Spatial is a component of Oracle Database. Oracle Spatial supports the object-relational model for representing the geometry. SDO_GEOMETRY.
29. 29. Oracle Spatial Examples
30. 30. Conclusion Spatial Databases are widely used nowadays. Optimizing Spatial Databases is of a significant importance. Spatial databases can be optimized using spatial indexes like R-tree or Quadtree and other indexing structures. Oracle supports spatial indexing using R-Tree and Quadtree.