{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Indexing2 - Note ATTRIBUTE LIST MULTIKEY INDEX(next e.g...

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

View Full Document Right Arrow Icon
ATTRIBUTE LIST MULTIKEY INDEX (next) e.g., CREATE INDEX foo ON R(A,B,C) Note
Image of page 1

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

View Full Document Right Arrow Icon
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.
Image of page 2
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) )
Image of page 3

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

View Full Document Right Arrow Icon
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.
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 6
Example Example Record Dept Index Salary Index Name=Joe DEPT=Sales SAL=15k Art Sales Toy 10k 15k 17k 21k 12k 15k 15k 19k
Image of page 7

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

View Full Document Right Arrow Icon
R-tree Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . query
Image of page 8
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.
Image of page 9

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

View Full Document Right Arrow Icon
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
Image of page 10
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
Image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern