-
Notifications
You must be signed in to change notification settings - Fork 2
range queries #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
range queries #74
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ void workload_executor(bliss::BlissIndex<key_type, value_type> &tree, | |
| size_t num_writes = std::round(config.write_factor * data.size()); | ||
| size_t num_mixed = num_inserts - (num_preload + num_writes); | ||
| size_t num_reads = std::round(config.read_factor * data.size()); | ||
| size_t num_ranges = std::round(config.range_query_factor * data.size()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that factor would be the best to reflect the performance of a range query as the number of entry data in an index is not always the same. I also changed the variable name to range_query_perc! |
||
|
|
||
| // Timing for preloading index | ||
| spdlog::debug("Preloading {} items", num_preload); | ||
|
|
@@ -143,8 +144,47 @@ void workload_executor(bliss::BlissIndex<key_type, value_type> &tree, | |
| executor::execute_non_empty_reads(tree, data, num_reads, seed); | ||
| }); | ||
| spdlog::info("Read Time (ns): {}", read_time); | ||
|
|
||
| // Timing for range queries with configured amount | ||
| if (num_ranges > 0) { | ||
| spdlog::debug("Executing {} range queries", num_ranges); | ||
| std::vector<unsigned long long> range_times; | ||
| std::string selectivity_values; | ||
|
|
||
| // Process all selectivity factors first | ||
| for (const auto& selectivity : config.selectivity_factor) { | ||
| auto range_time = 0ULL; | ||
| try { | ||
| range_time = time_function([&]() { | ||
| executor::execute_range_queries(tree, data, num_ranges, selectivity); | ||
| }); | ||
| } catch (const std::exception& e) { | ||
| if (std::string(e.what()) == "Not implemented") { | ||
| range_time = 0; | ||
| } else { | ||
| throw; | ||
| } | ||
| } | ||
|
|
||
| range_times.push_back(range_time); | ||
| if (!selectivity_values.empty()) { | ||
| selectivity_values += ", "; | ||
| } | ||
| selectivity_values += std::to_string(selectivity); | ||
| } | ||
|
|
||
| std::string time_values; | ||
| for (size_t i = 0; i < range_times.size(); ++i) { | ||
| if (i > 0) time_values += ", "; | ||
| time_values += std::to_string(range_times[i]); | ||
| } | ||
|
|
||
| spdlog::info("Range Query Times (ns) for selectivity [{}]: {}", | ||
| selectivity_values, time_values); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| int main(int argc, char *argv[]) { | ||
| auto config = args::parse_args(argc, argv); | ||
| switch (config.verbosity) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use better variable names - call this
selected_data_rangeorqualifying_data_range.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated!