CCF
Loading...
Searching...
No Matches
tpcc_setup.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "tpcc_common.h"
6#include "tpcc_tables.h"
7
8#include <exception>
9#include <set>
10#include <stdint.h>
11
12namespace tpcc
13{
14 class SetupDb
15 {
16 private:
18 bool already_run;
19 int32_t new_orders_per_district;
20 std::mt19937 rand_generator;
21
22 float random_float(float min, float max)
23 {
24 return tpcc::random_float(min, max, rand_generator);
25 }
26
27 uint32_t random_int(uint32_t min, uint32_t max)
28 {
29 return tpcc::random_int(min, max, rand_generator);
30 }
31
32 int32_t random_int_excluding(int lower, int upper, int excluding)
33 {
34 return tpcc::random_int_excluding(
35 lower, upper, excluding, rand_generator);
36 }
37
38 template <size_t T>
39 void create_random_string(
40 std::array<char, T>& str, uint32_t min, uint32_t max)
41 {
42 uint32_t rand;
43 if (min == max)
44 {
45 rand = min;
46 }
47 else
48 {
49 rand = random_int(min, max);
50 }
51
52 create_random_string(str, rand);
53 }
54
55 template <size_t T>
56 void create_random_string(std::array<char, T>& str, uint32_t length)
57 {
58 for (uint32_t i = 0; i < length - 1; ++i)
59 {
60 str[i] = 97 + random_int(0, 26); // lower case letters
61 }
62 str[length - 1] = '\0';
63 }
64
65 template <size_t T>
66 void create_random_int(std::array<char, T>& str, uint32_t length)
67 {
68 for (uint32_t i = 0; i < length - 1; ++i)
69 {
70 str[i] = 48 + random_int(0, 10); // lower case letters
71 }
72 str[length - 1] = '\0';
73 }
74
75 std::unordered_set<uint32_t> select_unique_ids(
76 uint32_t num_items_, uint32_t num_unique)
77 {
78 std::unordered_set<uint32_t> r;
79 for (uint32_t i = 0; i < num_items_; ++i)
80 {
81 r.insert(i);
82 }
83
84 while (r.size() > num_unique)
85 {
86 r.erase(r.begin());
87 }
88 return r;
89 }
90
91 template <size_t T>
92 void set_original(std::array<char, T>& s)
93 {
94 int position = random_int(0, T - 8);
95 memcpy(s.data() + position, "ORIGINAL", 8);
96 }
97
98 Stock generate_stock(uint32_t item_id, uint32_t wh_id, bool is_original)
99 {
100 Stock s;
101 s.i_id = item_id;
102 s.w_id = wh_id;
104 s.ytd = 0;
105 s.order_cnt = 0;
106 s.remote_cnt = 0;
107 for (int i = 0; i < District::NUM_PER_WAREHOUSE; ++i)
108 {
109 create_random_string(s.dist[i], sizeof(s.dist[i]));
110 }
111
112 if (is_original)
113 {
114 set_original(s.data);
115 }
116 else
117 {
118 create_random_string(
119 s.data, random_int(Stock::MIN_DATA, Stock::MAX_DATA));
120 }
121 return s;
122 }
123
124 void make_stock(uint32_t wh_id)
125 {
126 // Select 10% of the stock to be marked "original"
127 std::unordered_set<uint32_t> selected_rows =
128 select_unique_ids(num_items, num_items / 10);
129
130 for (uint32_t i = 1; i <= num_items; ++i)
131 {
132 bool is_original = selected_rows.find(i) != selected_rows.end();
133 Stock s = generate_stock(i, wh_id, is_original);
134 auto stocks = args.tx.rw(tpcc::TpccTables::stocks);
135 stocks->put(s.get_key(), s);
136 }
137 }
138
139 void generate_warehouse(int32_t id, Warehouse* warehouse)
140 {
141 warehouse->id = id;
142 warehouse->tax = random_float(Warehouse::MIN_TAX, Warehouse::MAX_TAX);
143 warehouse->ytd = Warehouse::INITIAL_YTD;
144 create_random_string(
145 warehouse->name, random_int(Warehouse::MIN_NAME, Warehouse::MAX_NAME));
146 create_random_string(
147 warehouse->street_1,
148 random_int(Address::MIN_STREET, Address::MAX_STREET));
149 create_random_string(
150 warehouse->street_2,
151 random_int(Address::MIN_STREET, Address::MAX_STREET));
152 create_random_string(
153 warehouse->city, random_int(Address::MIN_CITY, Address::MAX_CITY));
154 create_random_string(warehouse->state, Address::STATE, Address::STATE);
155 create_random_string(warehouse->zip, Address::ZIP);
156 }
157
158 void generate_district(int32_t id, int32_t w_id, District* district)
159 {
160 district->id = id;
161 district->w_id = w_id;
162 district->tax = random_float(District::MIN_TAX, District::MAX_TAX);
163 district->ytd = District::INITIAL_YTD;
164 district->next_o_id = customers_per_district + 1;
165 create_random_string(
167 create_random_string(
168 district->street_1, Address::MIN_STREET, Address::MAX_STREET);
169 create_random_string(
170 district->street_2, Address::MIN_STREET, Address::MAX_STREET);
171 create_random_string(
172 district->city, Address::MIN_CITY, Address::MAX_CITY);
173 create_random_string(district->state, Address::STATE, Address::STATE);
174 create_random_string(district->zip, Address::ZIP);
175 }
176
177 void generate_customer(
178 int32_t id,
179 int32_t d_id,
180 int32_t w_id,
181 bool bad_credit,
182 Customer* customer)
183 {
184 customer->id = id;
185 customer->d_id = d_id;
186 customer->w_id = w_id;
188 customer->discount =
194 create_random_string(
196 std::copy_n("OE", 2, customer->middle.begin());
197
198 if (id <= 1000)
199 {
200 make_last_name(id - 1, customer->last.data());
201 }
202 else
203 {
204 make_last_name(random_int(0, 1000), customer->last.data());
205 }
206
207 create_random_string(
208 customer->street_1, Address::MIN_STREET, Address::MAX_STREET);
209 create_random_string(
210 customer->street_2, Address::MIN_STREET, Address::MAX_STREET);
211 create_random_string(
212 customer->city, Address::MIN_CITY, Address::MAX_CITY);
213 create_random_string(customer->state, Address::STATE, Address::STATE);
214 create_random_string(customer->zip, Address::ZIP);
215 create_random_int(customer->phone, Customer::PHONE);
216 customer->since = tx_time;
217 if (bad_credit)
218 {
219 std::copy_n(
221 sizeof(Customer::BAD_CREDIT),
222 customer->credit.data());
223 }
224 else
225 {
226 std::copy_n(
228 sizeof(Customer::GOOD_CREDIT),
229 customer->credit.data());
230 }
231 create_random_string(
233 }
234
235 void generate_history(
236 int32_t c_id, int32_t d_id, int32_t w_id, History* history)
237 {
238 history->c_id = c_id;
239 history->c_d_id = d_id;
240 history->d_id = d_id;
241 history->c_w_id = w_id;
242 history->w_id = w_id;
244 history->date = tx_time;
245 create_random_string(history->data, History::MIN_DATA, History::MAX_DATA);
246 }
247
248 std::vector<int> make_permutation(int lower, int upper)
249 {
250 std::vector<int> array;
251 array.resize(upper);
252 for (int i = 0; i <= upper - lower; ++i)
253 {
254 array[i] = lower + i;
255 }
256
257 for (int i = 0; i < upper - lower; ++i)
258 {
259 int index = random_int(i, upper - lower);
260 int temp = array[i];
261 array[i] = array[index];
262 array[index] = temp;
263 }
264
265 return array;
266 }
267
268 void generate_order(
269 int32_t id,
270 int32_t c_id,
271 int32_t d_id,
272 int32_t w_id,
273 bool new_order,
274 Order* order)
275 {
276 order->id = id;
277 order->c_id = c_id;
278 order->d_id = d_id;
279 order->w_id = w_id;
280 if (!new_order)
281 {
282 order->carrier_id =
284 }
285 else
286 {
288 }
289 order->ol_cnt = random_int(Order::MIN_OL_CNT, Order::MAX_OL_CNT);
291 order->entry_d = tx_time;
292 }
293
294 void generate_order_line(
295 int32_t number,
296 int32_t o_id,
297 int32_t d_id,
298 int32_t w_id,
299 bool new_order,
300 OrderLine* orderline)
301 {
302 orderline->o_id = o_id;
303 orderline->d_id = d_id;
304 orderline->w_id = w_id;
305 orderline->number = number;
306 orderline->i_id = random_int(OrderLine::MIN_I_ID, OrderLine::MAX_I_ID);
307 orderline->supply_w_id = w_id;
309 if (!new_order)
310 {
311 orderline->amount = 0.00;
312 orderline->delivery_d = tx_time;
313 }
314 else
315 {
316 orderline->amount =
318 orderline->delivery_d[0] = '\0';
319 }
320 create_random_string(
321 orderline->dist_info,
322 sizeof(orderline->dist_info) - 1,
323 sizeof(orderline->dist_info) - 1);
324 }
325
326 void make_warehouse_without_stock(int32_t w_id)
327 {
328 Warehouse w;
329 generate_warehouse(w_id, &w);
330 auto warehouses = args.tx.rw(tpcc::TpccTables::warehouses);
331 warehouses->put(w.get_key(), w);
332
333 for (int32_t d_id = 1; d_id <= districts_per_warehouse; ++d_id)
334 {
335 District d;
336 generate_district(d_id, w_id, &d);
337 auto districts = args.tx.rw(tpcc::TpccTables::districts);
338 districts->put(d.get_key(), d);
339
340 // Select 10% of the customers to have bad credit
341 std::unordered_set<uint32_t> selected_rows = select_unique_ids(
342 customers_per_district / 10, customers_per_district);
343 for (int32_t c_id = 1; c_id <= customers_per_district; ++c_id)
344 {
345 Customer c;
346 bool bad_credit = selected_rows.find(c_id) != selected_rows.end();
347 generate_customer(c_id, d_id, w_id, bad_credit, &c);
348
350 table_key.v.w_id = w_id;
351 table_key.v.d_id = d_id;
352 auto it = tpcc::TpccTables::customers.find(table_key.k);
353 if (it == tpcc::TpccTables::customers.end())
354 {
355 std::string tbl_name = fmt::format("customer_{}_{}", w_id, d_id);
356 auto r = tpcc::TpccTables::customers.insert(
357 {table_key.k,
358 TpccMap<Customer::Key, Customer>(tbl_name.c_str())});
359 it = r.first;
360 }
361
362 auto customers = args.tx.rw(it->second);
363 customers->put(c.get_key(), c);
364
365 History h;
366 generate_history(c_id, d_id, w_id, &h);
367 auto history = args.tx.rw(tpcc::TpccTables::histories);
368 history->put(h.get_key(), h);
369 }
370
371 // TPC-C 4.3.3.1. says that this should be a permutation of [1,
372 // 3000]. But since it is for a c_id field, it seems to make sense to
373 // have it be a permutation of the customers. For the "real" thing this
374 // will be equivalent
375 std::vector<int> permutation =
376 make_permutation(1, customers_per_district);
377 for (int32_t o_id = 1; o_id <= customers_per_district; ++o_id)
378 {
379 // The last new_orders_per_district_ orders are new
380 bool new_order =
381 customers_per_district - new_orders_per_district < o_id;
382 Order o;
383 generate_order(
384 o_id, permutation[o_id - 1], d_id, w_id, new_order, &o);
385
387 table_key.v.w_id = w_id;
388 table_key.v.d_id = d_id;
389 auto it = tpcc::TpccTables::orders.find(table_key.k);
390 if (it == tpcc::TpccTables::orders.end())
391 {
392 std::string tbl_name = fmt::format("orders_{}_{}", w_id, d_id);
393 auto r = tpcc::TpccTables::orders.insert(
394 {table_key.k, TpccMap<Order::Key, Order>(tbl_name.c_str())});
395 it = r.first;
396 }
397
398 auto order = args.tx.rw(it->second);
399 order->put(o.get_key(), o);
400
401 // Generate each OrderLine for the order
402 for (int32_t ol_number = 1; ol_number <= o.ol_cnt; ++ol_number)
403 {
404 OrderLine line;
405 generate_order_line(ol_number, o_id, d_id, w_id, new_order, &line);
406 auto order_lines = args.tx.rw(tpcc::TpccTables::order_lines);
407 order_lines->put(line.get_key(), line);
408
409 if (new_order)
410 {
412 table_key_.v.w_id = w_id;
413 table_key_.v.d_id = d_id;
414 auto it_ = tpcc::TpccTables::new_orders.find(table_key_.k);
415 if (it_ == tpcc::TpccTables::new_orders.end())
416 {
417 std::string tbl_name =
418 fmt::format("new_orders_{}_{}", w_id, d_id);
419 auto r = tpcc::TpccTables::new_orders.insert(
420 {table_key_.k,
421 TpccMap<NewOrder::Key, NewOrder>(tbl_name.c_str())});
422 it_ = r.first;
423 }
424
425 NewOrder no;
426 no.w_id = w_id;
427 no.d_id = d_id;
428 no.o_id = o_id;
429
430 auto new_orders = args.tx.rw(it_->second);
431 new_orders->put(no.get_key(), no);
432 }
433 }
434 }
435 }
436 }
437
438 void generate_item(int32_t id, bool original)
439 {
440 Item item;
441 item.id = id;
442 item.im_id = random_int(Item::MIN_IM, Item::MAX_IM);
443 item.price = random_float(Item::MIN_PRICE, Item::MAX_PRICE);
444 create_random_string(item.name, Item::MIN_NAME, Item::MAX_NAME);
445 create_random_string(item.data, Item::MIN_DATA, Item::MAX_DATA);
446
447 if (original)
448 {
449 set_original(item.data);
450 }
451 auto items_table = args.tx.rw(tpcc::TpccTables::items);
452 items_table->put(item.get_key(), item);
453 }
454
455 // Generates num_items items and inserts them into tables.
456 void make_items()
457 {
458 // Select 10% of the rows to be marked "original"
459 auto original_rows = select_unique_ids(num_items, num_items / 10);
460
461 for (uint32_t i = 1; i <= num_items; ++i)
462 {
463 bool is_original = original_rows.find(i) != original_rows.end();
464 generate_item(i, is_original);
465 }
466 }
467
468 public:
471 int32_t new_orders_per_district_,
472 uint32_t seed) :
473 args(args_),
474 already_run(false),
475 new_orders_per_district(new_orders_per_district_)
476 {
477 rand_generator.seed(seed);
478 }
479
480 void run()
481 {
482 LOG_INFO_FMT("Start create");
483 if (already_run)
484 {
485 throw std::logic_error("Can only create the database 1 time");
486 }
487 already_run = true;
488
489 make_items();
490 for (uint32_t i = 0; i < num_warehouses; ++i)
491 {
492 make_stock(i);
493 make_warehouse_without_stock(i);
494 }
495 LOG_INFO_FMT("end create");
496 }
497 };
498}
M::Handle * rw(M &m)
Definition tx.h:213
Definition map.h:30
Definition tpcc_setup.h:15
SetupDb(ccf::endpoints::EndpointContext &args_, int32_t new_orders_per_district_, uint32_t seed)
Definition tpcc_setup.h:469
void run()
Definition tpcc_setup.h:480
#define LOG_INFO_FMT
Definition logger.h:395
Definition tpcc_common.h:8
Definition endpoint_context.h:55
ccf::kv::Tx & tx
Definition endpoint_context.h:61
Definition tpcc_tables.h:313
float balance
Definition tpcc_tables.h:348
std::array< char, CREDIT+1 > credit
Definition tpcc_tables.h:362
int32_t id
Definition tpcc_tables.h:343
static const int INITIAL_PAYMENT_CNT
Definition tpcc_tables.h:319
Key get_key()
Definition tpcc_tables.h:338
std::array< char, MIDDLE+1 > middle
Definition tpcc_tables.h:353
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:363
static const int MAX_FIRST
Definition tpcc_tables.h:322
float ytd_payment
Definition tpcc_tables.h:349
static constexpr float INITIAL_BALANCE
Definition tpcc_tables.h:317
static constexpr float INITIAL_CREDIT_LIM
Definition tpcc_tables.h:314
int32_t w_id
Definition tpcc_tables.h:345
static constexpr float MIN_DISCOUNT
Definition tpcc_tables.h:315
int32_t payment_cnt
Definition tpcc_tables.h:350
static const int MIN_FIRST
Definition tpcc_tables.h:321
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:359
static constexpr char BAD_CREDIT[]
Definition tpcc_tables.h:331
static constexpr float MAX_DISCOUNT
Definition tpcc_tables.h:316
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:355
int32_t delivery_cnt
Definition tpcc_tables.h:351
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:358
static const int MIN_DATA
Definition tpcc_tables.h:327
float credit_lim
Definition tpcc_tables.h:346
static constexpr float INITIAL_YTD_PAYMENT
Definition tpcc_tables.h:318
std::array< char, PHONE+1 > phone
Definition tpcc_tables.h:360
std::array< char, Address::MAX_CITY+1 > city
Definition tpcc_tables.h:357
float discount
Definition tpcc_tables.h:347
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:356
std::array< char, DATETIME_SIZE+1 > since
Definition tpcc_tables.h:361
static constexpr char GOOD_CREDIT[]
Definition tpcc_tables.h:330
static const int MAX_DATA
Definition tpcc_tables.h:328
static const int INITIAL_DELIVERY_CNT
Definition tpcc_tables.h:320
std::array< char, MAX_FIRST+1 > first
Definition tpcc_tables.h:352
std::array< char, MAX_LAST+1 > last
Definition tpcc_tables.h:354
int32_t d_id
Definition tpcc_tables.h:344
static const int PHONE
Definition tpcc_tables.h:325
Definition tpcc_tables.h:226
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:247
static const int NUM_PER_WAREHOUSE
Definition tpcc_tables.h:233
Key get_key()
Definition tpcc_tables.h:253
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:251
float tax
Definition tpcc_tables.h:243
int32_t next_o_id
Definition tpcc_tables.h:245
float ytd
Definition tpcc_tables.h:244
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:250
static const int MAX_NAME
Definition tpcc_tables.h:232
int32_t w_id
Definition tpcc_tables.h:242
static constexpr float MIN_TAX
Definition tpcc_tables.h:227
static const int MIN_NAME
Definition tpcc_tables.h:231
static constexpr float INITIAL_YTD
Definition tpcc_tables.h:229
static constexpr float MAX_TAX
Definition tpcc_tables.h:228
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:248
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:246
std::array< char, Address::MAX_CITY+1 > city
Definition tpcc_tables.h:249
int32_t id
Definition tpcc_tables.h:241
Definition tpcc_tables.h:507
static constexpr float INITIAL_AMOUNT
Definition tpcc_tables.h:510
int32_t w_id
Definition tpcc_tables.h:530
Key get_key()
Definition tpcc_tables.h:521
int32_t c_id
Definition tpcc_tables.h:526
static const int MAX_DATA
Definition tpcc_tables.h:509
int32_t c_w_id
Definition tpcc_tables.h:528
int32_t d_id
Definition tpcc_tables.h:529
int32_t c_d_id
Definition tpcc_tables.h:527
static const int MIN_DATA
Definition tpcc_tables.h:508
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:533
std::array< char, DATETIME_SIZE+1 > date
Definition tpcc_tables.h:532
float amount
Definition tpcc_tables.h:531
Definition tpcc_tables.h:157
float price
Definition tpcc_tables.h:180
int32_t im_id
Definition tpcc_tables.h:179
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:182
static const int MIN_DATA
Definition tpcc_tables.h:164
static constexpr float MAX_PRICE
Definition tpcc_tables.h:161
int32_t id
Definition tpcc_tables.h:178
Key get_key()
Definition tpcc_tables.h:173
static const int MAX_NAME
Definition tpcc_tables.h:163
static const int MIN_NAME
Definition tpcc_tables.h:162
static constexpr float MIN_PRICE
Definition tpcc_tables.h:160
static const int MAX_DATA
Definition tpcc_tables.h:165
static const int MIN_IM
Definition tpcc_tables.h:158
static const int MAX_IM
Definition tpcc_tables.h:159
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:181
Definition tpcc_tables.h:482
int32_t w_id
Definition tpcc_tables.h:497
Key get_key()
Definition tpcc_tables.h:492
int32_t o_id
Definition tpcc_tables.h:499
int32_t d_id
Definition tpcc_tables.h:498
Definition tpcc_tables.h:432
int32_t supply_w_id
Definition tpcc_tables.h:458
Key get_key()
Definition tpcc_tables.h:448
static const int MAX_I_ID
Definition tpcc_tables.h:434
std::array< char, Stock::DIST+1 > dist_info
Definition tpcc_tables.h:462
static constexpr float MIN_AMOUNT
Definition tpcc_tables.h:436
int32_t o_id
Definition tpcc_tables.h:453
int32_t number
Definition tpcc_tables.h:456
std::array< char, DATETIME_SIZE+1 > delivery_d
Definition tpcc_tables.h:461
int32_t quantity
Definition tpcc_tables.h:459
int32_t d_id
Definition tpcc_tables.h:454
float amount
Definition tpcc_tables.h:460
int32_t i_id
Definition tpcc_tables.h:457
static const int MIN_I_ID
Definition tpcc_tables.h:433
static constexpr float MAX_AMOUNT
Definition tpcc_tables.h:437
int32_t w_id
Definition tpcc_tables.h:455
static const int INITIAL_QUANTITY
Definition tpcc_tables.h:435
Definition tpcc_tables.h:394
Key get_key()
Definition tpcc_tables.h:411
int32_t w_id
Definition tpcc_tables.h:419
int32_t carrier_id
Definition tpcc_tables.h:420
int32_t c_id
Definition tpcc_tables.h:417
static const int MAX_OL_CNT
Definition tpcc_tables.h:400
int32_t id
Definition tpcc_tables.h:416
std::array< char, DATETIME_SIZE+1 > entry_d
Definition tpcc_tables.h:423
static const int MAX_CARRIER_ID
Definition tpcc_tables.h:396
int32_t d_id
Definition tpcc_tables.h:418
int32_t all_local
Definition tpcc_tables.h:422
static const int MIN_CARRIER_ID
Definition tpcc_tables.h:395
static const int MIN_OL_CNT
Definition tpcc_tables.h:399
static const int NULL_CARRIER_ID
Definition tpcc_tables.h:397
int32_t ol_cnt
Definition tpcc_tables.h:421
static const int INITIAL_ALL_LOCAL
Definition tpcc_tables.h:401
Definition tpcc_tables.h:277
int32_t ytd
Definition tpcc_tables.h:288
int32_t order_cnt
Definition tpcc_tables.h:289
int32_t quantity
Definition tpcc_tables.h:287
static const int MAX_DATA
Definition tpcc_tables.h:282
std::array< std::array< char, DIST+1 >, District::NUM_PER_WAREHOUSE > dist
Definition tpcc_tables.h:291
int32_t i_id
Definition tpcc_tables.h:285
Key get_key()
Definition tpcc_tables.h:301
static const int MAX_QUANTITY
Definition tpcc_tables.h:279
static const int MIN_QUANTITY
Definition tpcc_tables.h:278
int32_t remote_cnt
Definition tpcc_tables.h:290
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:293
static const int MIN_DATA
Definition tpcc_tables.h:281
int32_t w_id
Definition tpcc_tables.h:286
static std::unordered_map< uint64_t, TpccMap< Order::Key, Order > > orders
Definition tpcc_tables.h:565
static TpccMap< Stock::Key, Stock > stocks
Definition tpcc_tables.h:559
static std::unordered_map< uint64_t, TpccMap< NewOrder::Key, NewOrder > > new_orders
Definition tpcc_tables.h:568
static TpccMap< District::Key, District > districts
Definition tpcc_tables.h:561
static TpccMap< OrderLine::Key, OrderLine > order_lines
Definition tpcc_tables.h:566
static TpccMap< History::Key, History > histories
Definition tpcc_tables.h:562
static TpccMap< Warehouse::Key, Warehouse > warehouses
Definition tpcc_tables.h:560
static std::unordered_map< uint64_t, TpccMap< Customer::Key, Customer > > customers
Definition tpcc_tables.h:564
static TpccMap< Item::Key, Item > items
Definition tpcc_tables.h:569
Definition tpcc_tables.h:190
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:217
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:212
Key get_key()
Definition tpcc_tables.h:204
static constexpr float MAX_TAX
Definition tpcc_tables.h:192
static const int MAX_NAME
Definition tpcc_tables.h:195
float ytd
Definition tpcc_tables.h:211
std::array< char, Address::MAX_STREET+1 > city
Definition tpcc_tables.h:215
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:214
static constexpr float MIN_TAX
Definition tpcc_tables.h:191
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:216
int32_t id
Definition tpcc_tables.h:209
static const int MIN_NAME
Definition tpcc_tables.h:194
float tax
Definition tpcc_tables.h:210
static constexpr float INITIAL_YTD
Definition tpcc_tables.h:193
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:213
Definition tpcc_tables.h:547
int32_t d_id
Definition tpcc_tables.h:551
int32_t w_id
Definition tpcc_tables.h:550
struct tpcc::TpccTables::DistributeKey::@2 v
uint64_t k
Definition tpcc_tables.h:553