ACM SIGMOD 2015 Programming Contest
Alexey Karyakin (Crisis)
David R. Cheriton School of Computer Science University of Waterloo
Validation in Optimistic Concurrency Control ACM SIGMOD 2015 - - PowerPoint PPT Presentation
Validation in Optimistic Concurrency Control ACM SIGMOD 2015 Programming Contest Alexey Karyakin (Crisis) David R. Cheriton School of Computer Science University of Waterloo The Problem Alexey Karyakin 2 06/02/15 Database and Query
ACM SIGMOD 2015 Programming Contest
Alexey Karyakin (Crisis)
David R. Cheriton School of Computer Science University of Waterloo
2 06/02/15
Alexey Karyakin
3 06/02/15
Alexey Karyakin
Primary key size, transaction and row insertion/deletion rate Queries / validation, predicates / query, length of queried txn range, flush batch size
Satisfied predicates (per type), queries, validations How often a column is used in queries
4 06/02/15
Alexey Karyakin
~105 rows)
predicates in each query
Overall, satisfied validation probability: ~5%
5 06/02/15
Alexey Karyakin
Index data and iterate over queries in each batch
Resort to table scan
6 06/02/15
Alexey Karyakin
STX B-tree
New records are appended to the front Old records are deleted (“forget”) from the back only
7 06/02/15
Alexey Karyakin
Small at start, automatically expanded
Records are chained in historic order
Non-indexed columns Hash collisions
8 06/02/15
Alexey Karyakin
9 06/02/15
Alexey Karyakin
Find the field with better selectivity Some columns have only a few unique values – scan is better
The number of records inserted between updating a hash slot
10 06/02/15
Alexey Karyakin
most-recently inserted record
probability of evaluating to true
Min and max values are computed for blocks of records and are used to accelerate the scan
11 06/02/15
Alexey Karyakin
threads via producer-consumer queues
12 06/02/15
Alexey Karyakin input
Main thread Table 0 queue Table N queue
Work queue Work queue
Work queue
list of queries evaluated to true
Stage 1: reading and parsing input, distributing data between table queues, batch processing coordination
13 06/02/15
Alexey Karyakin input
Main thread Table 0 queue Table N queue
Work queue Work queue
Work queue
list of queries evaluated to true
Stage 2: updating data and indexes, initial phase of query evaluation
14 06/02/15
Alexey Karyakin input
Main thread Table 0 queue Table N queue
Work queue Work queue
Work queue
list of queries evaluated to true
Stage 3: complete query evaluation
15 06/02/15
Alexey Karyakin
between tables (one table was especially heavy)
processing
16 06/02/15
Alexey Karyakin
This page intentionally left blank
Thank you.