-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmysql-index.cc
More file actions
28 lines (20 loc) · 787 Bytes
/
mysql-index.cc
File metadata and controls
28 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "MysqlIndex.hh"
#include <stdlib.h>
#include <iostream>
// Get command line arguments for array size (100M) and number of trials (1M)
void arrayArgs(int argc, char* argv[], objectId_t& asize, int& reps) {
asize = (argc>1) ? strtoull(argv[1], 0, 0) : 100000000;
reps = (argc>2) ? strtol(argv[2], 0, 0) : 1000000;
}
// Main program goes here
int main(int argc, char* argv[]) {
objectId_t arraySize;
int queryTrials;
arrayArgs(argc, argv, arraySize, queryTrials);
std::cout << "MySQL (InnoDB) Table " << arraySize << " elements, "
<< queryTrials << " trials" << std::endl;
MysqlIndex theDB(2); // Verbosity
theDB.setTableSize(40e6); // Use smaller blocks of data for efficiency
theDB.CreateTable(arraySize);
theDB.ExerciseTable(queryTrials);
}