summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/file_util.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-05-25 14:15:36 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-05-25 14:15:36 -0400
commitcd961cc231ca3073f03d82b99153a6d0f5a4c7f1 (patch)
tree706b4e8b8ceaa15c61ac5f1bcbb3daa40f32d76e /benchmarks/include/file_util.h
parent7f823ef35733230d3fd1e12e52fecde89f415e8b (diff)
downloaddynamic-extension-cd961cc231ca3073f03d82b99153a6d0f5a4c7f1.tar.gz
Added selectivity sweep benchmark
Diffstat (limited to 'benchmarks/include/file_util.h')
-rw-r--r--benchmarks/include/file_util.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmarks/include/file_util.h b/benchmarks/include/file_util.h
index 39b297b..2d340e6 100644
--- a/benchmarks/include/file_util.h
+++ b/benchmarks/include/file_util.h
@@ -87,6 +87,26 @@ static std::vector<QP> read_range_queries(std::string &fname,
}
template <typename QP>
+static std::vector<QP> generate_uniform_range_queries(size_t n, size_t key_limit, double selectivity) {
+ std::vector<QP> queries;
+
+ gsl_rng *rng = gsl_rng_alloc(gsl_rng_mt19937);
+ size_t query_size = key_limit * selectivity;
+
+ for (size_t i=0; i<n; i++) {
+ QP q;
+ q.lower_bound = gsl_rng_uniform_int(rng, key_limit - query_size);
+ q.upper_bound = q.lower_bound + query_size;
+
+ queries.push_back(q);
+ }
+
+ gsl_rng_free(rng);
+
+ return queries;
+}
+
+template <typename QP>
static std::vector<QP> read_sosd_point_lookups(std::string &fname, size_t n) {
std::vector<QP> queries;