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

Issue 102: Page store: performance bugs

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