diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2025-05-29 12:42:42 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2025-05-29 12:42:42 -0400 |
| commit | 484818ba5f755c98702b43c84892d7ab3ededa4e (patch) | |
| tree | ddfd14210adb27b82dee79f5d00f5edc90b5e158 /benchmarks/include | |
| parent | fc87a983830b5fd727d7873ae609a038966163a0 (diff) | |
| parent | cd961cc231ca3073f03d82b99153a6d0f5a4c7f1 (diff) | |
| download | dynamic-extension-484818ba5f755c98702b43c84892d7ab3ededa4e.tar.gz | |
Merge branch 'new-concurrency' of github.com:dbrumbaugh/dynamic-extension-working into new-concurrency
Diffstat (limited to 'benchmarks/include')
| -rw-r--r-- | benchmarks/include/file_util.h | 20 |
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; |