提交 4f3a6422 authored 作者: christian.peter.io's avatar christian.peter.io

New experimental feature "SHUTDOWN DEFRAG". This option optimizes the page layout so

    that a full table scan is faster.
上级 74827696
......@@ -524,11 +524,14 @@ public class PageStore implements CacheWriter {
ri.close();
}
recordPageReads = false;
int free = getFirstFree(); // We swap, so this page is fix
if (free == -1) {
DbException.throwInternalError("no free page for defrag");
} else {
int currentSeqPosInDb = MIN_PAGE_COUNT;
for (int i = 0; i < recordedPagesList.size(); i++) {
writeBack();
cache.clear();
int free = getFirstFree();
int a = currentSeqPosInDb;
int b = recordedPagesList.get(i);
......@@ -546,11 +549,11 @@ public class PageStore implements CacheWriter {
}
recordedPagesList.set(i, a);
// Find next PageDataLeaf
while (true) {
currentSeqPosInDb++;
if (currentSeqPosInDb >= pageCount) {
currentSeqPosInDb = -1;
break;
}
Page currentPage = getPage(currentSeqPosInDb);
if (currentPage == null) {
......@@ -561,6 +564,7 @@ public class PageStore implements CacheWriter {
}
}
}
}
recordedPagesList = null;
recordedPagesSet = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论