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

Files do not grow more than 128 pages. For large databases, 20% was too much.

上级 1538a750
...@@ -23,6 +23,7 @@ Change Log ...@@ -23,6 +23,7 @@ Change Log
</li><li>When creating a table, the precision must now be at least as large as the scale. </li><li>When creating a table, the precision must now be at least as large as the scale.
</li><li>Support for Java 1.3 and Java 1.4 has been removed. </li><li>Support for Java 1.3 and Java 1.4 has been removed.
</li><li>Improved error message for syntax error: the list of expected tokens was sometimes not set correctly. </li><li>Improved error message for syntax error: the list of expected tokens was sometimes not set correctly.
</li><li>Files do not grow more than 128 pages. For large databases, 20% was too much.
</li></ul> </li></ul>
<h2>Version 1.3.154 (2011-04-04)</h2> <h2>Version 1.3.154 (2011-04-04)</h2>
......
...@@ -123,6 +123,7 @@ public class PageStore implements CacheWriter { ...@@ -123,6 +123,7 @@ public class PageStore implements CacheWriter {
private static final int MIN_PAGE_COUNT = 6; private static final int MIN_PAGE_COUNT = 6;
private static final int INCREMENT_KB = 1024; private static final int INCREMENT_KB = 1024;
private static final int INCREMENT_PERCENT_MIN = 20; private static final int INCREMENT_PERCENT_MIN = 20;
private static final int INCREMENT_MAX_PAGES = 128;
private static final int READ_VERSION = 3; private static final int READ_VERSION = 3;
private static final int WRITE_VERSION = 3; private static final int WRITE_VERSION = 3;
private static final int META_TYPE_DATA_INDEX = 0; private static final int META_TYPE_DATA_INDEX = 0;
...@@ -1134,6 +1135,9 @@ public class PageStore implements CacheWriter { ...@@ -1134,6 +1135,9 @@ public class PageStore implements CacheWriter {
if (increment < percent) { if (increment < percent) {
increment = (1 + (percent / increment)) * increment; increment = (1 + (percent / increment)) * increment;
} }
if (increment > INCREMENT_MAX_PAGES) {
increment = INCREMENT_MAX_PAGES;
}
increaseFileSize(increment); increaseFileSize(increment);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论