apply more update till root
This commit is contained in:
@ -512,6 +512,11 @@ class BPlusTreeIndexer {
|
|||||||
prev_page_guard.template As<PageType>()
|
prev_page_guard.template As<PageType>()
|
||||||
->data.p_data[prev_page_guard.template As<PageType>()->data.key_count - 1]
|
->data.p_data[prev_page_guard.template As<PageType>()->data.key_count - 1]
|
||||||
.first;
|
.first;
|
||||||
|
if (need_update) {
|
||||||
|
// now we need to check if we have to update the right bound till the root
|
||||||
|
pos.path.pop_back();
|
||||||
|
TryUpdateTillRoot(pos);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -546,6 +551,9 @@ class BPlusTreeIndexer {
|
|||||||
.second;
|
.second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// now we need to check if we have to update the right bound till the root
|
||||||
|
pos.path.pop_back();
|
||||||
|
TryUpdateTillRoot(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,13 +40,17 @@ int main() {
|
|||||||
{
|
{
|
||||||
BPlusTreeIndexer<ValType, std::less<ValType>> bpt(buffer_pool_manager);
|
BPlusTreeIndexer<ValType, std::less<ValType>> bpt(buffer_pool_manager);
|
||||||
int n;
|
int n;
|
||||||
|
// freopen("/workspaces/BH-TicketSystem/build/pro.in", "r", stdin);
|
||||||
|
// freopen("/workspaces/BH-TicketSystem/build/pro.out", "w", stdout);
|
||||||
std::ios::sync_with_stdio(false);
|
std::ios::sync_with_stdio(false);
|
||||||
std::cin.tie(nullptr);
|
std::cin.tie(nullptr);
|
||||||
std::cout.tie(nullptr);
|
std::cout.tie(nullptr);
|
||||||
std::string op, index;
|
std::string op, index;
|
||||||
int val;
|
int val;
|
||||||
std::cin >> n;
|
std::cin >> n;
|
||||||
|
int opt_cnt = 0;
|
||||||
while (n-- > 0) {
|
while (n-- > 0) {
|
||||||
|
++opt_cnt;
|
||||||
std::cin >> op;
|
std::cin >> op;
|
||||||
if (op[0] == 'i') {
|
if (op[0] == 'i') {
|
||||||
std::cin >> index >> val;
|
std::cin >> index >> val;
|
||||||
@ -73,6 +77,9 @@ int main() {
|
|||||||
std::cout << '\n';
|
std::cout << '\n';
|
||||||
} else
|
} else
|
||||||
throw std::runtime_error("Invalid operation");
|
throw std::runtime_error("Invalid operation");
|
||||||
|
// if (opt_cnt >= 133768) {
|
||||||
|
// bpt.CheckIndex();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete buffer_pool_manager;
|
delete buffer_pool_manager;
|
||||||
|
@ -21,8 +21,8 @@ int main(int argc, char *argv[]) {
|
|||||||
fprintf(fout, "Seed = %u\n", RndSeed);
|
fprintf(fout, "Seed = %u\n", RndSeed);
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
// ======================================
|
// ======================================
|
||||||
int n = 100000;
|
int n = 300000;
|
||||||
int total_keys = 30000;
|
int total_keys = 100000;
|
||||||
set<string> keys_set;
|
set<string> keys_set;
|
||||||
for (int i = 0; i < total_keys; i++) {
|
for (int i = 0; i < total_keys; i++) {
|
||||||
string key = "#" + to_string(rnd_less(1000000)) + "#";
|
string key = "#" + to_string(rnd_less(1000000)) + "#";
|
||||||
|
Reference in New Issue
Block a user