Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef TPCCGENERATED_HPP_
- #define TPCCGENERATED_HPP_
- #include <iostream>
- #include <set>
- #include <tuple>
- #include <tbb/concurrent_unordered_map.h>
- #include <tbb/blocked_range.h>
- #include <tbb/parallel_for.h>
- #include "../helper/helper.hpp"
- #include "../type/Types.hpp"
- #include "../type/tpcc_schema.hpp"
- #include "../storage/RowStore.hpp"
- // THIS METHOD EXECUTES THE QUERY
- extern "C" {
- void run(Database *db) {
- std::cout << " c_id | w_id |" << std::endl;
- std::cout
- << "--------------------------------------------------------------------------"
- << std::endl;
- typedef Integer join_attr_0;
- typedef Integer store_attr_0;
- tbb::concurrent_unordered_map<join_attr_0,
- tbb::concurrent_vector<store_attr_0>, std::hash<join_attr_0>> ht_0;
- tbb::parallel_for(size_t(0), size_t(db->customer->size() - 1),
- [&] (size_t index) {
- auto i_0 = db->customer->getByTid(index);
- ht_0[i_0.c_w_id].push_back(i_0.c_id);
- });
- tbb::parallel_for(size_t(0), size_t(db->warehouse->size() - 1),
- [&] (size_t index) {
- auto i_1 = db->warehouse->getByTid(index);
- for (store_attr_0 hx_0 : ht_0[i_1.w_id]) {
- std::cout << " " << hx_0 << " |" << " " << i_1.w_id << " |" << std::endl;
- }
- });
- std::cout << std::endl << std::endl;
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement