@@ -97,7 +97,7 @@ int main() {
97
97
{
98
98
auto tims_costing_second =
99
99
Measurement (" Get Database" , thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id thread_id) {
100
- __attribute__ ((unused)) auto ignored = infinity->GetDatabase (" default " );
100
+ __attribute__ ((unused)) auto ignored = infinity->GetDatabase (" default_db " );
101
101
});
102
102
results.push_back (fmt::format (" -> Get Database QPS: {}" , total_times / tims_costing_second));
103
103
}
@@ -146,31 +146,31 @@ int main() {
146
146
{
147
147
// Init Table
148
148
SharedPtr<Infinity> infinity = Infinity::LocalConnect ();
149
- // auto [ database, status ] = infinity->GetDatabase("default ");
149
+ // auto [ database, status ] = infinity->GetDatabase("default_db ");
150
150
__attribute__ ((unused)) auto ignored =
151
- infinity->CreateTable (" default " , " benchmark_test" , column_defs, Vector<TableConstraint *>(), create_table_opts);
151
+ infinity->CreateTable (" default_db " , " benchmark_test" , column_defs, Vector<TableConstraint *>(), create_table_opts);
152
152
infinity->LocalDisconnect ();
153
153
}
154
154
// {
155
155
// auto tims_costing_second = Measurement(thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id
156
156
// thread_id) {
157
- // __attribute__((unused)) auto ignored = infinity->GetDatabase("default ")->ListTables();
157
+ // __attribute__((unused)) auto ignored = infinity->GetDatabase("default_db ")->ListTables();
158
158
// });
159
159
// results.push_back(fmt::format("-> List Tables QPS: {}", total_times / tims_costing_second));
160
160
// }
161
161
{
162
162
auto tims_costing_second =
163
163
Measurement (" Get Tables" , thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id thread_id) {
164
- // auto [ database, status ] = infinity->GetDatabase("default ");
165
- __attribute__ ((unused)) auto ignored = infinity->GetTable (" default " , " benchmark_test" );
164
+ // auto [ database, status ] = infinity->GetDatabase("default_db ");
165
+ __attribute__ ((unused)) auto ignored = infinity->GetTable (" default_db " , " benchmark_test" );
166
166
});
167
167
results.push_back (fmt::format (" -> Get Tables QPS: {}" , total_times / tims_costing_second));
168
168
}
169
169
{
170
170
auto tims_costing_second =
171
171
Measurement (" Describe Tables" , thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id thread_id) {
172
- // auto [ database, status ] = infinity->GetDatabase("default ");
173
- __attribute__ ((unused)) auto ignored = infinity->ShowTable (" default " , " benchmark_test" );
172
+ // auto [ database, status ] = infinity->GetDatabase("default_db ");
173
+ __attribute__ ((unused)) auto ignored = infinity->ShowTable (" default_db " , " benchmark_test" );
174
174
});
175
175
results.push_back (fmt::format (" -> Describe Tables QPS: {}" , total_times / tims_costing_second));
176
176
}
@@ -191,16 +191,16 @@ int main() {
191
191
auto col_def_2 = new ColumnDef (1 , col_type, col_name_2, HashSet<ConstraintType>());
192
192
column_definitions.emplace_back (col_def_2);
193
193
194
- // auto [database, status] = infinity->GetDatabase("default ");
194
+ // auto [database, status] = infinity->GetDatabase("default_db ");
195
195
__attribute__ ((unused)) auto ignored =
196
- infinity->CreateTable (" default " , std::to_string (i), column_definitions, Vector<TableConstraint *>(), create_table_opts);
196
+ infinity->CreateTable (" default_db " , std::to_string (i), column_definitions, Vector<TableConstraint *>(), create_table_opts);
197
197
});
198
198
results.push_back (fmt::format (" -> Create Table QPS: {}" , total_times / tims_costing_second));
199
199
}
200
200
{
201
201
auto tims_costing_second =
202
202
Measurement (" Drop Table" , thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id thread_id) {
203
- __attribute__ ((unused)) auto ignored = infinity->DropTable (" default " , std::to_string (i), drop_table_options);
203
+ __attribute__ ((unused)) auto ignored = infinity->DropTable (" default_db " , std::to_string (i), drop_table_options);
204
204
});
205
205
results.push_back (fmt::format (" -> Drop Table QPS: {}" , total_times / tims_costing_second));
206
206
}
@@ -217,7 +217,7 @@ int main() {
217
217
col2->names_ .emplace_back (" col2" );
218
218
output_columns->emplace_back (col2);
219
219
220
- __attribute__ ((unused)) auto ignored = infinity->Search (" default " , " benchmark_test" , nullptr , nullptr , output_columns);
220
+ __attribute__ ((unused)) auto ignored = infinity->Search (" default_db " , " benchmark_test" , nullptr , nullptr , output_columns);
221
221
});
222
222
results.push_back (fmt::format (" -> Select QPS: {}" , total_times / tims_costing_second));
223
223
}
@@ -239,7 +239,7 @@ int main() {
239
239
value2->integer_value_ = i;
240
240
values->at (0 )->emplace_back (value2);
241
241
242
- __attribute__ ((unused)) auto ignored = infinity->Insert (" default " , " benchmark_test" , columns, values);
242
+ __attribute__ ((unused)) auto ignored = infinity->Insert (" default_db " , " benchmark_test" , columns, values);
243
243
});
244
244
results.push_back (fmt::format (" -> Insert QPS: {}" , total_times / tims_costing_second));
245
245
}
@@ -267,14 +267,14 @@ int main() {
267
267
values->push_back (update_expr1);
268
268
values->push_back (update_expr2);
269
269
270
- __attribute__ ((unused)) auto ignored = infinity->Update (" default " , " benchmark_test" , nullptr , values);
270
+ __attribute__ ((unused)) auto ignored = infinity->Update (" default_db " , " benchmark_test" , nullptr , values);
271
271
});
272
272
results.push_back (fmt::format (" -> Update QPS: {}" , total_times / tims_costing_second));
273
273
}
274
274
{
275
275
auto tims_costing_second =
276
276
Measurement (" Delete" , thread_num, total_times, [&](SizeT i, SharedPtr<Infinity> infinity, std::thread::id thread_id) {
277
- __attribute__ ((unused)) auto ignored = infinity->Delete (" default " , " benchmark_test" , nullptr );
277
+ __attribute__ ((unused)) auto ignored = infinity->Delete (" default_db " , " benchmark_test" , nullptr );
278
278
});
279
279
results.push_back (fmt::format (" -> Delete QPS: {}" , total_times / tims_costing_second));
280
280
}
@@ -305,7 +305,7 @@ int main() {
305
305
306
306
SharedPtr<Infinity> infinity = Infinity::LocalConnect ();
307
307
__attribute__ ((unused)) auto ignored =
308
- infinity->CreateTable (" default " , " benchmark_test" , column_definitions, Vector<TableConstraint *>(), create_table_opts);
308
+ infinity->CreateTable (" default_db " , " benchmark_test" , column_definitions, Vector<TableConstraint *>(), create_table_opts);
309
309
infinity->LocalDisconnect ();
310
310
}
311
311
{
@@ -326,7 +326,7 @@ int main() {
326
326
value2->integer_value_ = std::rand ();
327
327
values->at (0 )->emplace_back (value2);
328
328
329
- __attribute__ ((unused)) auto ignored = infinity->Insert (" default " , " benchmark_test" , columns, values);
329
+ __attribute__ ((unused)) auto ignored = infinity->Insert (" default_db " , " benchmark_test" , columns, values);
330
330
});
331
331
results.push_back (fmt::format (" -> Insert for Sort Time: {}s" , tims_costing_second));
332
332
}
@@ -359,7 +359,7 @@ int main() {
359
359
auto col1_def = std::make_unique<ColumnDef>(0 , col1_type, col1_name, std::unordered_set<ConstraintType>());
360
360
column_defs.emplace_back (col1_def.release ());
361
361
362
- std::string db_name = " default " ;
362
+ std::string db_name = " default_db " ;
363
363
std::string table_name = " knn_benchmark" ;
364
364
std::string index_name = " hnsw_index" ;
365
365
@@ -407,7 +407,7 @@ int main() {
407
407
// std::cout << "--- Start to run search benchmark: ";
408
408
// auto tims_costing_second = Measurement(thread_num, total_times, [&](size_t i, std::shared_ptr<Infinity> infinity,
409
409
// std::thread::id thread_id) {
410
- // __attribute__((unused)) auto ignored = infinity->GetDatabase("default ")->GetTable("benchmark_test")->Search(nullptr, nullptr,
410
+ // __attribute__((unused)) auto ignored = infinity->GetDatabase("default_db ")->GetTable("benchmark_test")->Search(nullptr, nullptr,
411
411
// nullptr);
412
412
// });
413
413
// results.push_back(fmt::format("-> SEARCH QPS: {}", total_times / tims_costing_second));
0 commit comments