diff options
| -rw-r--r-- | benchmarks/vldb/ts_parmsweep.cpp | 2 | ||||
| -rw-r--r-- | include/framework/structure/BufferView.h | 6 | ||||
| -rw-r--r-- | include/query/rangecount.h | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/benchmarks/vldb/ts_parmsweep.cpp b/benchmarks/vldb/ts_parmsweep.cpp index fd71e11..2c9412a 100644 --- a/benchmarks/vldb/ts_parmsweep.cpp +++ b/benchmarks/vldb/ts_parmsweep.cpp @@ -18,7 +18,7 @@ typedef de::Record<uint64_t, uint64_t> Rec; typedef de::TrieSpline<Rec> Shard; -typedef de::rc::Query<Rec, Shard> Q; +typedef de::rc::Query<Rec, Shard, true> Q; typedef de::DynamicExtension<Rec, Shard, Q, de::LayoutPolicy::TEIRING, de::DeletePolicy::TOMBSTONE, de::SerialScheduler> Ext; typedef de::DynamicExtension<Rec, Shard, Q, de::LayoutPolicy::LEVELING, de::DeletePolicy::TOMBSTONE, de::SerialScheduler> Ext2; typedef de::rc::Parms<Rec> QP; diff --git a/include/framework/structure/BufferView.h b/include/framework/structure/BufferView.h index 44a2044..11b8337 100644 --- a/include/framework/structure/BufferView.h +++ b/include/framework/structure/BufferView.h @@ -112,6 +112,10 @@ public: size_t get_record_count() { return m_tail - m_head; } + + size_t get_capacity() { + return m_cap; + } /* * NOTE: This function returns an upper bound on the number @@ -123,7 +127,7 @@ public: } Wrapped<R> *get(size_t i) { - assert(i < get_record_count()); + //assert(i < get_record_count()); return m_data + to_idx(i); } diff --git a/include/query/rangecount.h b/include/query/rangecount.h index 5a18ed4..5b95cdd 100644 --- a/include/query/rangecount.h +++ b/include/query/rangecount.h @@ -35,7 +35,7 @@ struct BufferState { : buffer(buffer) {} }; -template <KVPInterface R, ShardInterface<R> S> +template <KVPInterface R, ShardInterface<R> S, bool FORCE_SCAN=false> class Query { public: constexpr static bool EARLY_ABORT=false; @@ -119,8 +119,16 @@ public: res.rec.value = 0; // tombstones records.emplace_back(res); + size_t stop_idx; + if constexpr (FORCE_SCAN) { + stop_idx = s->buffer->get_capacity() / 2; + } else { + stop_idx = s->buffer->get_record_count(); + } + for (size_t i=0; i<s->buffer->get_record_count(); i++) { auto rec = s->buffer->get(i); + if (rec->rec.key >= p->lower_bound && rec->rec.key <= p->upper_bound && !rec->is_deleted()) { if (rec->is_tombstone()) { |