提交 13f9174d authored 作者: Andrei Tokar's avatar Andrei Tokar

employ append mode for MVPlainTempResult

上级 474ed5bc
......@@ -61,14 +61,15 @@ class MVPlainTempResult extends MVTempResult {
MVPlainTempResult(Database database, Expression[] expressions, int visibleColumnCount) {
super(database, expressions.length, visibleColumnCount);
ValueDataType valueType = new ValueDataType(database.getCompareMode(), database, new int[columnCount]);
Builder<Long, ValueArray> builder = new MVMap.Builder<Long, ValueArray>().valueType(valueType);
Builder<Long, ValueArray> builder = new MVMap.Builder<Long, ValueArray>()
.valueType(valueType).singleWriter();
map = store.openMap("tmp", builder);
}
@Override
public int addRow(Value[] values) {
assert parent == null;
map.put(counter++, ValueArray.get(values));
map.append(counter++, ValueArray.get(values));
return ++rowCount;
}
......
......@@ -160,7 +160,7 @@ public abstract class MVTempResult implements ResultExternal {
MVTempResult(Database database, int columnCount, int visibleColumnCount) {
try {
String fileName = FileUtils.createTempFile("h2tmp", Constants.SUFFIX_TEMP_FILE, false, true);
Builder builder = new MVStore.Builder().fileName(fileName);
Builder builder = new MVStore.Builder().fileName(fileName).cacheSize(0);
byte[] key = database.getFileEncryptionKey();
if (key != null) {
builder.encryptionKey(MVTableEngine.decodePassword(key));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论