提交 79268cf1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 102: Page store: performance bugs

上级 533c8426
......@@ -82,18 +82,6 @@ public class PageBtreeIndex extends BaseIndex {
if (trace.isDebugEnabled()) {
trace.debug("add " + row.getPos());
}
if (tableData.getContainsLargeObject()) {
for (int i = 0; i < row.getColumnCount(); i++) {
Value v = row.getValue(i);
Value v2 = v.link(database, getId());
if (v2.isLinked()) {
session.unlinkAtCommitStop(v2);
}
if (v != v2) {
row.setValue(i, v2);
}
}
}
// safe memory
SearchRow newRow = getSearchRow(row);
while (true) {
......
......@@ -276,11 +276,8 @@ public class FileStore {
* @param len the number of bytes to read
*/
public void readFully(byte[] b, int off, int len) throws SQLException {
if (SysProperties.CHECK && len < 0) {
Message.throwInternalError("read len " + len);
}
if (SysProperties.CHECK && len % Constants.FILE_BLOCK_SIZE != 0) {
Message.throwInternalError("unaligned read " + name + " len " + len);
if (SysProperties.CHECK && (len < 0 || len % Constants.FILE_BLOCK_SIZE != 0)) {
Message.throwInternalError("unaligned write " + name + " len " + len);
}
checkPowerOff();
try {
......@@ -329,10 +326,7 @@ public class FileStore {
* @param len the number of bytes to write
*/
public void write(byte[] b, int off, int len) throws SQLException {
if (SysProperties.CHECK && len < 0) {
Message.throwInternalError("read len " + len);
}
if (SysProperties.CHECK && len % Constants.FILE_BLOCK_SIZE != 0) {
if (SysProperties.CHECK && (len < 0 || len % Constants.FILE_BLOCK_SIZE != 0)) {
Message.throwInternalError("unaligned write " + name + " len " + len);
}
checkWritingAllowed();
......
......@@ -320,7 +320,7 @@ public class PageStore implements CacheWriter {
// write back the free list
writeBack();
byte[] empty = new byte[pageSize];
// TODO avoid to write empty pages
// TODO avoid to write empty pages more than once
for (int i = PAGE_ID_FREE_LIST_ROOT; i < pageCount; i++) {
if (!isUsed(i)) {
file.seek((long) i << pageSizeShift);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论