Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Spatial Query Processing for High Resolutions Hans-Peter Kriegel, Martin Pfeifle, Marco Pötke, Thomas Seidl 8 th International DASFAA-Conference March, 2003, Kyoto, Japan Database Group Institute for Computer Science University of Munich, Germany
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Outline of the Talk 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions Spatial Databases Voxelized Objects High Resolutions Outline of the Talk
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Spatial Database Management Systems collision queries System Requirements: Effectivity Efficiency Scalability Concurrency Control Recovery complex box queries spatialobjects Spatial Database Management Systems (based on extensible ORDBMS)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Voxelized Spatial Objects triangulated objects voxel sequence 1.) linearization of the data space – grid-approximation – space filling curve interval sequence 2.) interval sequence – bottom-up or top-down – size-bound or error-bound
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Query Processing for High Resolutions Filter - Step Candidate Set for Application Specific Refinement Step Spatial - DB Refinement Step ORDBMSORDBMS CADCAD Result e.g. RI-Tree High Resolution HRI-Approach
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions Relational Interval Tree [VLDB 00] [VLDB 00] Extensible Indexing Outline of the Talk
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Relational Interval Tree (RI-Tree) 3a3a 15 a 12 c 5c5c 15 a A B C D 7b7b 1b1b 13 d Foundation: Interval Tree [ Edelsbrunner 1980 ]
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich D Foundation: Interval Tree [ Edelsbrunner 1980 ] 1. Idea: Virtualization of the Primary Structure 3a3a 15 a 12 c 5c5c 15 a b7b 1b1b 13 d h – 1 root = 2 h–1 Relational Interval Tree (RI-Tree)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Foundation: Interval Tree [ Edelsbrunner 1980 ] 1. Idea: Virtualization of the Primary Structure 2. Idea: Managing of the Secondary Structure by 2 B + -trees nodelower id bacdbacd nodeupper id bcadbcad lowerIndexupperIndex Relational Interval Tree (RI-Tree) root = 2 h– a3a 15 a 12 c 5c5c 15 a 7b7b 1b1b 13 d A B C D
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 1. Procedural Step 2. Declarative Step RI-Tree: Intersection Query
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 1. Procedural Step 16 = root 24 = fork Declarative Step – posting one single SQL-statement – number of I/O-accesses: O(h·log b n + r/b) arithmetic traversal of the primary structure collecting the visited nodes in transient tables number of I/0-accesses: 0 select id from upperIndex i, :leftNodes left where i.node = left.node and i.upper >= :Q.lower union all select id from lowerIndex i, :rightNodes right where i.node = right.node and i.lower <= :Q.upper union all select id from upperIndex i where i.node between :Q.lower and :Q.upper upper = = lower query Q RI-Tree: Intersection Query
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich User-defined Index Structure [VLDB 00] [SSTD 01] Extensible Indexing Framework Object-relational interface for index maintenance and querying functions. Relational Implementation Mapping to built-in indexes (B + -trees); SQL-based query processing Physical Implementation Block-Manager, Caches, Locking, Logging, … User-defined Cost Model [SSDBM 02] Extensible Optimization Framework Object-relational interface for selectivity estimation and cost prediction functions. Relational Implementation Mapping to built-in statistics facilities; SQL-based evaluation of cost model Declarative Embedding Object-relational DML and DDL RI-Tree: Integration into an ORDBMS
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Outline of the Talk 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions Grey Intervals Storage of Grey Intervals in an Intervals in an ORDBMS ORDBMS Intersection Queries based on based on Grey Intervals Grey Intervals
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Grey Intervals A voxelized “real-world” object Black object interval sequence (obtained from encoding voxels via a space filling curve) Grey object interval sequence (obtained from grouping black intervals together) O grey = ( id, (2, 5), (7, 7) , (12, 12), (15, 15),(18, 18) , (22, 29) , (36, 36), (39, 39),(42, 42) , (46, 47) ) (2, 5), (7, 7) Grey Interval
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich +- bit-orientedapproachoffset-orientedapproach Storage of a Grey Object Interval Sequence O (L) w1w1 w1w2w3w4w1w2w3w4 O (n * log L) w2w2 w3w3 w4w4 table schema GreyIntervals (id, intervalsequence) BLOB aggregated information H(I grey ), D(I grey ), G(I grey )
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Multi-Step Query Processing for Intersection Queries A 1 Q 1 A 3 Q 2 A 2 Q 1 B 3 Q 1 B 2 Q 1 C 1 Q 1 C 2 Q 1 C 2 Q 2 C 3 Q 2 D 1 Q 1 A 1 Q 1 A 3 Q 2 C 1 Q 1 DB Query Q A 1 Q 1 A 3 Q 2 A 2 Q 1 + B 3 Q 1 C 1 Q 1 C 2 Q 1 B 2 Q 1 ? result set Interval Index 1. filter step FAST GREY TEST 2. filter step BLOB TEST 3. filter step D1 Q1D1 Q1 A C B Q 1 Q 2 A 1 A 2 A 3 A B 1 B 2 B 3 B C 1 C 2 C 3 C 4 C D 1 D 2 D E 1 E... B 3 Q 1 + +
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 2. filter step: FAST-GREY-TEST black interval + grey interval black interval covers the starting or end point of the grey interval grey interval + grey interval share the same starting or end point grey interval + grey interval number of white cells is smaller than the intersecting area... black interval + black interval L grey interval + other interval grey interval has only two black cells and the other interval is completely included in this interval grey interval + grey interval grey intervals have only two black cells and the intervals have no common starting or end point intersection no intersection long black interval + grey interval maximum gap of the grey interval smaller than the length of the black interval intersection test based on the aggregated information of the grey intervals.
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 3. filter step: BLOB-TEST intersection test based on the examination of the black interval sequence... I2I2 I1I1 runtime analysis runtime analysis bit-oriented approach finding the starting point A of the interlacing area testing the L voxels L oLoL A O (1) O (L)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich 3. filter step: BLOB-TEST... L I2I2 I1I1 w 1 w 2 w 3 w 4 w 5 w 6 w 7 w 8 A w6w6 w4w4 w7w7 n 1 = 8 n L1 = 1 n L2 = 3 runtime analysis runtime analysis offset-oriented approach finding the starting point of the interlacing area testing the n L1 resp. n L2 intervals O (log n 1 ) O (n L1 +n L2 ) intersection test based on the examination of the black interval sequence bit-oriented approach finding the starting point A of the interlacing area testing the L voxels O (1) O (L)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich SQL-Statement SELECT candidates.id FROM (SELECT db.id AS id, table (AggInfos(db.intervalsequence, q.intervalsequence)) AS ctable FROM GreyIntervals db, :GreyQueryIntervals q WHERE intersects (hull(db.intervalsequence), hull(q.intervalsequence)) GROUP BY db.id )candidates WHERE EXISTS (SELECT 1 FROM GreyIntervals db, :GreyQueryIntervals q, candidates.ctable ctable WHERE db.rowid = ctable.dbrowid AND q.rowid = ctable.qrowid AND blobintersection (db.intervalsequence, q.intervalsequence) ) intersects (hull(db.intervalsequence), hull(q.intervalsequence)) table (AggInfos(db.intervalsequence, q.intervalsequence)) blobintersection (db.intervalsequence, q.intervalsequence)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Outline of the Talk 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Experimental Evaluation Examination of the HRI approach based on different MAXGAP Parameters: ,000 10, ,000 1,000,000 Comparison between the HRI approach and the spatial variant of the RI-tree [SSTD 01] CAR PLANE approx. 200 parts approx parts approx. 7 million intervals approx. 9 million intervals resolution: 33 bit ( ) resolution: 42 bit ( )
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Experiments CAR number of interval decreases with increasing MAXGAP - parameter average interval length increases with increasing MAXGAP - parameter - Interval Distribution
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Experiments – Secondary Storage With the HRI method we can improve the storage requirement by an order of magnitude. (RI-Tree)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Experiments – Runtime for collision queries PLANE CAR
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Experiments – Runtime for collision queries PLANE CAR RI-tree huge part (PLANE) RI-tree: s HRI: 2.2 s (Maxgap=10,000)
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Outline of the Talk 1.) Introduction 2.) RI-Tree 3.) HRI-Approach 4.) Experimental Evaluation 5.) Conclusions
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich What are the advantages of the HRI approach? good secondary storage utilization Conclusions What is the HRI approach? the HRI approach is a multi-step index structure suitable for spatial query processing for high resolutions small main memory footprint improved query response time behaviour
Kyoto, 03/26/03 Kyoto, 03/26/03 Martin Pfeifle, Database Group, University of Munich Any questions? ? ? ? ? ? ? ?