提交 6bcc31f4 authored 作者: noelgrandin's avatar noelgrandin

Remove the "h2.MAX_MEMORY_ROWS_DISTINCT" system property to reduce confusion.

We already have the MAX_MEMORY_ROWS setting which does a very similar thing, and is better documented.
上级 be2d01c8
...@@ -156,16 +156,6 @@ public class DbSettings extends SettingsBase { ...@@ -156,16 +156,6 @@ public class DbSettings extends SettingsBase {
*/ */
public final int maxCompactTime = get("MAX_COMPACT_TIME", 200); public final int maxCompactTime = get("MAX_COMPACT_TIME", 200);
/**
* Database setting <code>MAX_MEMORY_ROWS_DISTINCT</code> (default:
* 10000).<br />
* The maximum number of rows kept in-memory for SELECT DISTINCT queries. If
* more than this number of rows are in a result set, a temporary table is
* used.
*/
public final int maxMemoryRowsDistinct = get("MAX_MEMORY_ROWS_DISTINCT",
10000);
/** /**
* Database setting <code>MAX_QUERY_TIMEOUT</code> (default: 0).<br /> * Database setting <code>MAX_QUERY_TIMEOUT</code> (default: 0).<br />
* The maximum timeout of a query in milliseconds. The default is 0, meaning * The maximum timeout of a query in milliseconds. The default is 0, meaning
......
...@@ -260,7 +260,7 @@ public class LocalResult implements ResultInterface, ResultTarget { ...@@ -260,7 +260,7 @@ public class LocalResult implements ResultInterface, ResultTarget {
distinctRows.put(array, values); distinctRows.put(array, values);
rowCount = distinctRows.size(); rowCount = distinctRows.size();
Database db = session.getDatabase(); Database db = session.getDatabase();
if (rowCount > db.getSettings().maxMemoryRowsDistinct && if (rowCount > db.getMaxMemoryRows() &&
db.isPersistent() && !db.isReadOnly()) { db.isPersistent() && !db.isReadOnly()) {
external = new ResultTempTable(session, sort); external = new ResultTempTable(session, sort);
rowCount = external.addRows(distinctRows.values()); rowCount = external.addRows(distinctRows.values());
......
...@@ -53,7 +53,7 @@ public class TestCases extends TestBase { ...@@ -53,7 +53,7 @@ public class TestCases extends TestBase {
testDependencies(); testDependencies();
testConvertType(); testConvertType();
testSortedSelect(); testSortedSelect();
testMaxMemoryRowsDistinct(); testMaxMemoryRows();
testDeleteTop(); testDeleteTop();
testUnicode(); testUnicode();
testOuterJoin(); testOuterJoin();
...@@ -278,10 +278,10 @@ public class TestCases extends TestBase { ...@@ -278,10 +278,10 @@ public class TestCases extends TestBase {
conn.close(); conn.close();
} }
private void testMaxMemoryRowsDistinct() throws SQLException { private void testMaxMemoryRows() throws SQLException {
deleteDb("cases"); deleteDb("cases");
Connection conn = getConnection( Connection conn = getConnection(
"cases;max_memory_rows_distinct=1"); "cases;max_memory_rows=1");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("create table test(id int primary key)"); stat.execute("create table test(id int primary key)");
stat.execute("insert into test values(1), (2)"); stat.execute("insert into test values(1), (2)");
......
...@@ -96,7 +96,7 @@ public class TestDeadlock extends TestBase { ...@@ -96,7 +96,7 @@ public class TestDeadlock extends TestBase {
private void testConcurrentLobReadAndTempResultTableDelete() throws Exception { private void testConcurrentLobReadAndTempResultTableDelete() throws Exception {
deleteDb("deadlock"); deleteDb("deadlock");
String url = "deadlock;MAX_MEMORY_ROWS_DISTINCT=10"; String url = "deadlock;MAX_MEMORY_ROWS=10";
Connection conn, conn2; Connection conn, conn2;
Statement stat2; Statement stat2;
conn = getConnection(url); conn = getConnection(url);
......
...@@ -96,7 +96,7 @@ public class TestReadOnly extends TestBase { ...@@ -96,7 +96,7 @@ public class TestReadOnly extends TestBase {
conn.close(); conn.close();
conn = getConnection( conn = getConnection(
"readonlyTemp;ACCESS_MODE_DATA=r;" + "readonlyTemp;ACCESS_MODE_DATA=r;" +
"MAX_MEMORY_ROWS_DISTINCT=10"); "MAX_MEMORY_ROWS=10");
stat = conn.createStatement(); stat = conn.createStatement();
stat.execute("SELECT DISTINCT ID FROM TEST"); stat.execute("SELECT DISTINCT ID FROM TEST");
conn.close(); conn.close();
......
...@@ -98,7 +98,7 @@ public class TestTempTables extends TestBase { ...@@ -98,7 +98,7 @@ public class TestTempTables extends TestBase {
private void testTempTableResultSet() throws SQLException { private void testTempTableResultSet() throws SQLException {
deleteDb("tempTables"); deleteDb("tempTables");
Connection conn = getConnection( Connection conn = getConnection(
"tempTables;MAX_MEMORY_ROWS_DISTINCT=10"); "tempTables;MAX_MEMORY_ROWS=10");
Statement stat1 = conn.createStatement( Statement stat1 = conn.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
Statement stat2 = conn.createStatement( Statement stat2 = conn.createStatement(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论