890 likes | 1.15k Views
MonetDB, Cracking and recycling. Martin Kersten CWI Amsterdam. Try to maximize performance. Present. Materialized Views. Potency. Paste. Cracking. B-tree, Hash Indices. Find a trusted fortune teller. Indices in database systems focus on:
E N D
MonetDB, Cracking and recycling Martin Kersten CWI Amsterdam
Try to maximize performance Present Materialized Views Potency Paste Cracking B-tree, Hash Indices
Find a trusted fortune teller • Indices in database systems focus on: • All tuples are equally important for fast retrieval • There are ample resources to maintain indices • MonetDB cracks the database into pieces based on actual query load
Cracking algorithms Physical reorganization happens per column based on selection predicates. Split a piece of a column intwonew pieces A<10 A<10 A>=10
Cracking algorithms Physical reorganization happens per column Split a piece of a column intwonew pieces Split a piece of a column inthree new pieces A<5 A<10 A<10 5<A<10 5<A<10 A>=10 A>=10
Cracking example select A>5 and A<10 17 3 8 6 2 12 13 4 15
Cracking example select A>5 and A<10 17 17 3 3 8 8 6 6 2 2 15 15 13 13 4 4 12 12
Cracking example select A>5 and A<10 >=10 17 17 3 3 8 8 6 6 2 2 15 15 13 13 4 4 12 12 >=10
Cracking example select A>5 and A<10 >=10 17 17 3 3 8 8 6 6 2 2 15 15 13 13 4 4 12 12
Cracking example select A>5 and A<10 >=10 17 17 3 3 8 8 6 6 2 2 15 15 13 13 <=5 4 4 12 12
Cracking example select A>5 and A<10 >=10 17 17 3 3 8 8 6 6 4 2 2 15 15 13 13 <=5 4 12 12
Cracking example select A>5 and A<10 >=10 17 3 3 8 8 6 6 4 2 2 15 15 13 13 <=5 4 17 12 12
Cracking example select A>5 and A<10 >=10 17 4 3 3 8 8 6 6 2 2 15 15 13 13 <=5 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 8 8 6 6 2 2 15 15 13 13 >=10 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 8 8 6 6 2 2 15 15 >=10 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 8 8 6 6 <=5 2 2 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 <=5 8 8 6 6 <=5 2 2 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 >5 and <10 8 8 6 6 <=5 2 2 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 >5 and <10 8 8 6 6 2 <=5 2 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 >5 and <10 8 6 6 2 <=5 2 8 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 >5 and <10 8 2 6 6 <=5 2 8 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 3 3 8 2 6 6 >5 and <10 2 8 15 15 13 13 4 17 12 12
Cracking example select A>5 and A<10 17 4 <= 5 3 3 8 2 6 6 > 5 2 8 15 15 13 13 >= 10 4 17 12 12
Cracking example Improve data access for future queries select A>5 and A<10 17 4 <= 5 3 3 8 2 6 6 > 5 2 8 15 15 13 13 >= 10 4 17 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 <= 5 3 3 8 2 6 6 > 5 2 8 15 15 13 13 >= 10 4 17 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 4 <= 5 <= 5 3 3 3 8 2 2 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 4 <= 5 <= 5 3 3 3 8 2 2 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 4 <= 5 <= 5 3 3 3 8 2 2 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
racking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 >3 and <14 17 4 4 <= 5 <= 5 3 3 3 <=3 8 2 2 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 >3 and <14 17 4 4 <= 5 <= 5 3 3 2 3 <=3 8 2 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 >3 and <14 17 4 <= 5 <= 5 3 3 2 3 <=3 8 2 4 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 >3 and <14 17 4 2 <= 5 <= 5 3 3 3 <=3 8 2 4 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <= 5 <= 5 3 3 3 <=3 8 2 4 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 >= 10 >= 10 4 17 17 12 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 15 13 13 13 12 >= 10 >= 10 4 17 17 12 12
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 13 13 13 12 >= 10 >= 10 4 17 17 12 12 15
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 12 13 13 13 >= 10 >= 10 4 17 17 12 12 15
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 12 13 13 13 >= 10 >= 10 4 17 17 12 12 15
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 12 13 13 13 >= 10 >= 10 4 17 17 12 12 15
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 12 >=10 13 13 13 >= 10 4 17 17 >= 14 12 12 15
Cracking example Improve data access for future queries select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 > 3 6 6 6 > 5 > 5 2 8 8 15 15 12 >=10 13 13 13 >= 10 4 17 17 >= 14 12 12 15
Cracking example Improve data access for future queries The more we crack the more we learn select A>5 and A<10 select A>3 and A<14 17 4 2 <=3 <= 5 3 3 3 8 2 4 >3 6 6 6 > 5 > 5 2 8 8 15 15 12 >=10 13 13 13 >= 10 4 17 17 >= 14 12 12 15
Design Thefirsttime a range query is posed on an attribute A, a cracking DBMS makes acopyof column A, called the cracker column of A A cracker column iscontinuouslyphysically reorganized based on queries thatneedto touch attribute such as the result is in a contiguous space For each cracker column, there is a cracker index Cracker Index Cracker Column
Try to avoid useless investments A simple range query
Try to avoid useless investments TPC-H query 6
Try to avoid useless investments • Cracking is easy in a column store and is part of the critical execution path • Cracking works under high volume updates
Updates • Base columns are updated as normally • We need to update the cracker column and the cracker index • Efficiently • Maintain the self-organization properties • Two issues: • When • How
When to propagate updates in cracking • Follow the workload to maintain self-organization • Updates become part of query processing • When an update arrives, it is not applied • For each cracker column there is • a pending insertions column • and a pending deletions column • Pending updates are appliedonly when a query needs the specific values