cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

PerformVectorizedRead optimization #1386

Closed pervazea closed 6 years ago

pervazea commented 6 years ago
  1. We should separate the visibility check from the addition to the read-write set in TransactionRuntime::PerformVectorizedRead(). (transaction_runtime.cpp line 28) Visibility should be checked for all tuples, but PerformRead() should only be called for tuples that pass the scan predicate. Otherwise, all visible tuples will be added to the read-write set, which is too conservative. (Prashanth suggesting splitting the function into two. Check visibility. Interpose scan predicate check. Second portion that does PerformRead).

  2. The last argument to TransactionManager::PerformRead() should not be false (transaction_runtime.cpp, line 62). It should be a function argument fed from the scan plan (i.e., SeqScanPlan::IsForUpdate).

The first change should yield significant improvement for high-selectivity predicates since 54% of time is spend in PerformRead(). The second one is for correctness.