《基于主存R树的空间连接的实现》由会员分享,可在线阅读,更多相关《基于主存R树的空间连接的实现(3页珍藏版)》请在金锄头文库上搜索。
1、null nulll: 2003- 04- 08;:2003- 06- 04null nullTe:( 1970- ) ,o,V,=,1Z_:bWo.cI|: 1001- 9081( 2003) 09- 0090- 03iRbWLC李null 萍(盐城工学院计算机工程系,江苏盐城 224003)Knull1: 空间查询效率是衡量数据库性能的关键,而空间连接查询是最耗时a最重要的空间查询b对几种典型的空间连接方法作了简单回顾,并具体给出了基于R树的空间连接算法( RJ)在空间数据库管理系统SADBS中的实现b1oM: 空间连接; R树;算法;空间数据库ms|: TP311. 131 null n
2、ullDSM:AImplementation of Spatial Join Based on Mainnullmemory RnulltreeLI Ping(Computer Engineering Department, Yancheng Institute of Technology, Yancheng Jiangsu 224003 ,China)Abstract: The efficiency of spatial query is the key to evaluate the performance of spatial databases, while spatial join
3、is themost timenullconsuming and important query. We first review the typical methods of spatial join, then implement the algorithm of spatialjoin based on Rnulltree ( RJ) in our spatial database system, SADBS.Key words: spatial join; Rnulltree; algorithm; spatial database1 null 引言bWoi%aLudbW,tbWbWo
4、KRT,bWotrbnbWa3g(S)aM(u)a$aaK#abW1 ,bWK1aKHbWbbWV_BbWM(ac)bWb,u,M#g,V?1psMiOgu,9u9bW1bWbB1V,6B1Vg,7TbB,T1,cbW,*1bW3M,tMubbW,VbWMBRbWbIn, A= A1 , A2 , null, An , B = B1 , B2 , null, Bm ,Ai , Bi(VATL,AiBisYc1-bMBR9MBR( Ai ) null MBR( Bi ) nullnullAiBi ,7bW5AiBi89M BR( ai ) null M BR( bi ) nullnullaibi
5、b2 null 常见的空间连接查询方法2. 1null0 2 ( Seeded Tree Join, STJ)L!bW1AaB,1ARRA,71B( BV?6BbWT)bSTJZEbW1A0,|bW1B,/BR(0) ,RJZE1bWbm1 null0VA,0c03(m1U) ,00,M33b0l( seeding phase),RA17S_/k(0,50k- 1);33( growing phase),1B,V/s_.0;b( cleannullup phase)1B(0,1|MBRLMBR,i|cslotb30B,Y?b2. 2nullHashbW 3 ( Saptial Hashnull
6、Join, HJ)HJ|1TsYT=( innerdatasets)( outer datasets) ,s7第23卷第9期2003年9月 null计算机应用Computer Applications nullVol. 23, No. 9Sept. , 2003a9M$T=a( inner buckets)a( outer buckets)bHJ1pybs:su( partition phase)n5BssBFV?a,=9$sBMSa,aMH,|a,m2U,aM5$Vr;( join phase)5taTbm2 null HJsu3 null 基于R树的空间连接 4 ( Rnulltree J
7、oin, RJ)Brinkhoff1993MD 4)PRLCbWZERJ,RJrqiOR$ level= = 0 & r2- level= 0)null* r1 and r2 are leaf nodes* nullOutput ( r1. e x . ref.O. ID, r2. e y .ref. O.ID) ;else if ( r1- level= = 0) null* r2 is not a leaf node* nullSearchForJoin( r1. ex , r2. e y .ref. child)else if ( r2- level= = 0) null* r1 is
8、not a leaf node* nullSearchForJoin( r2. ex , r1. e y .ref. child)else null* r1 and r2 are not leaf nodes* nullrect= IntersectRect( r1- ex . r, r2- e y . r) ;SpatialJoin(r1. e x .ref. child, r2. ey . ref. child, rect) ;Algorithm SortAndIntersectionTestInput: R_treeNode * r1, R_treeNode * r2;Rect r= M
9、BRr1nullMBRr2Output: a sequence of pair of entries, for each pair, their MBRs intersecteach other1. Scan all entries of r1 and r2, mark those intersect r;2. Reset r = r null ( MBR of all marked entries of r1) null( MBR of allmarked entries of r2) ;3. Find the subsets of marked entries from r1 and r2
10、 which intersect newrect, remark the subsets;4. Sort the remarked entries at r1;5. Sort the remarked entries at r2;6. while ( inull numOfRemarkedEntriesAtR1 &jnull numOfRemarkedEntriesAtR2)if ( r1. e i . r. pt1.x ,ri .pt1. x null ri+ 1 . pt1. x( 1 null i bE65pM=bVPMLZT,L!Bt,5tr1seq null r2seqP/xUSKl*(9V1/7ZT,5