




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
E-Commerce is taking over the traditional commerce practices. It is of special concern for the IT students. Following are the key points of these Lecture Slides : Tree Structure, Sequence, Node Containing Keys, Records Per Leaf, Insertion, Search, Leave, Insert Key, Tree Balanced, Disk Accesses
Typology: Slides
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Index node is a sequence of [pointer, key] pairs
-^
1
2
n-
n-
1
points to a node containing keys < K
1
points to a node containing keys in range [Ki
i-
)i
n^
points to a node containing keys > K
n-
So, K ´
1
2
n-
n-
i^
i^
i+
1
1
n-
n
i^
i^
i+
1
1
n-
n
Notice that leaves are sorted by key, left-to-right
-^
Search for value v by following path from the root
-^
If key = 8 bytes, ptr = 2 bytes, page = 4K, then n = 409
-^
So 3-level index has up to 68M leaves (
At 20 records per leaf, that’s 136M records
-^
-^
-^
-^
-^
drop prefix and add to suffix as you move down the tree
-^
and (Budget < 350))
-^
lock the key range [221, 352) record
indexed field
Commonly used with multi-granularity locking– Insert/delete locks record and intention-write locks range– MGL tree defines a fixed set of predicates, and thereby
avoids predicate satisfiability
Root lock on a B-tree is a bottleneck
-^
Use tree locking to relieve it
-^
Problem: node splits
-^
So, don’t unlock a node till you’re sure its child won’t split(i.e. has space for an insert)
-^
Implies different locking rules for different ops(search vs. insert/update)
If you unlock P before splitting C,then you have to back up and lockP again, which breaks the treelocking protocol.
B-link tree - Each node has a side pointer to the next
-^
After searching a node, you can release its lock beforelocking its child^ –
r
[P] r 1
[P] r 2
[C] w 2
[C] w 2
[C´] w 2
[P] r 2
[C] r 1
Searching has the same behavior as if it locked the childbefore releasing the parent … and ran later (after the insert)