Indexing2 - ATTRIBUTE LIST ⇒ MULTIKEY INDEX (next) e.g.,...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ATTRIBUTE LIST ⇒ MULTIKEY INDEX (next) e.g., CREATE INDEX foo ON R(A,B,C) Note Multidimensional Index Structures • One dimensional index structures assume a single search key, and retrieve records that match a given search-key value. (The search key can be a single field or a combination of fields.) • Many applications, e.g. GIS, OLAP, require us to view data as existing in a space of two or more dimensions. SELECT * FROM Points p WHERE NOT EXISTS ( SELECT * FROM Points q WHERE (q.x-10)*(q.x-10) + (q.y-20)*(q.y- 20) < (p.x-10)*(p.x-10) + (p.y-20)*(p.y-20) ) Multi-dimensional Indexing • Examples: – Sales information described by store, day, item, color, size, etc. Sale = point in multidimensional space. – Student described by age, zipcode, marital status. – Location of restaurants in a city. – Map data: zones, county lines, rivers, lakes, etc. (Data has spatial extent) • Queries: – Range Query: “Find all McDonald restaurant within a given region”. – Nearest Neighbor Query: “Find the nearest McDonald to my house”. – Partial Match Queries: All data within specified values in a subset of dimensions. Approach: Utilize Single Dimensional Index • Index on attributes independently • Project query range to each attribute, determine pointers. • Intersect pointers • Go to the database and retrieve objects in the intersection. May result in very high I/O cost Multiple Key Index • Index on one attribute provides pointers to an index on the other Index on first attribute Index on second attribute • Cannot support partial match queries on second attribute • Performance of range search not much better compared to independent attribute approach • The secondary indices may be of different sizes -- specifically some of them may be very small Example Example Record Dept Index Salary Index Name=Joe DEPT=Sales SAL=15k Art Sales Toy 10k 15k 17k 21k 12k 15k 15k 19k R-tree Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . query R-tree Data Structure • Extension of B-tree to multidimensional space. • Balanced, guaranteed storage utilization. • Can support both point data and data with spatial extent • Groups objects into possibly overlapping clusters (rectangles in our case) • Search for range query proceeds along all paths that overlap with the query. R-tree Insert Object E • Step I1 – ChooseLeaf(L) to Insert E /* find position to insert*/ • Step I2 – If L has room insert E – Else SplitNode(L) • Step I3: – Adjust Tree /* propagate Changes*/ • Step I4: – If node split propagates to root adjust height of tree ChooseLeaf • Step CL1: – Set L to be root • Step CL2: – If L is a leaf return L • Step CL3: – If L is not a root, let F be an entry whose rectangle needs least enlargement to include object • break ties by choosing smaller rectangle • Step CL4 – Set L to be child node pointed by entry F – goto Step CL2 Split Node...
View Full Document

This note was uploaded on 04/10/2008 for the course CSE 671 taught by Professor Hakanferhatosmanoglu during the Fall '06 term at Ohio State.

Page1 / 46

Indexing2 - ATTRIBUTE LIST ⇒ MULTIKEY INDEX (next) e.g.,...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online