PIBinaryLog recreate index performance patch

This commit is contained in:
2021-06-10 20:05:23 +03:00
parent d71432136c
commit d839832ee6
2 changed files with 4 additions and 1 deletions

View File

@@ -153,6 +153,7 @@ bool PIBinaryLog::openDevice() {
bool PIBinaryLog::closeDevice() {
stopThreadedRead();
pausemutex.unlock();
logmutex.unlock();
moveIndex(-1);
is_indexed = false;
index.clear();
@@ -654,7 +655,9 @@ bool PIBinaryLog::createIndex() {
llong cp = file.pos();
file.seekToBegin();
index.clear();
index = PIVector<BinLogIndex>();
index_pos.clear();
index_pos = PIMap<llong, int>();
parseLog(&file, &binfo, &index);
file.seek(cp);
is_indexed = !index.isEmpty();