提交 6cf69f57 authored 作者: Thomas Mueller's avatar Thomas Mueller

An optimization for IN(..) and IN(SELECT...) using the system property h2.optimizeInList

上级 fe4a8bec
......@@ -40,10 +40,6 @@ public class IndexCursor implements Cursor {
private LocalResult inResult;
private HashSet<Value> inResultTested;
public IndexCursor(Session session) {
this.session = session;
}
public void setIndex(Index index) {
this.index = index;
this.table = index.getTable();
......@@ -65,7 +61,8 @@ public class IndexCursor implements Cursor {
*
* @param indexConditions the index conditions
*/
public void find(ObjectArray<IndexCondition> indexConditions) throws SQLException {
public void find(Session session, ObjectArray<IndexCondition> indexConditions) throws SQLException {
this.session = session;
alwaysFalse = false;
start = end = null;
inList = null;
......
......@@ -92,7 +92,7 @@ public class TableFilter implements ColumnResolver {
this.table = table;
this.alias = alias;
this.select = select;
this.cursor = new IndexCursor(session);
this.cursor = new IndexCursor();
if (!rightsChecked) {
session.getUser().checkRight(table, Right.SELECT);
}
......@@ -246,7 +246,7 @@ public class TableFilter implements ColumnResolver {
if (state == AFTER_LAST) {
return false;
} else if (state == BEFORE_FIRST) {
cursor.find(indexConditions);
cursor.find(session, indexConditions);
if (!cursor.isAlwaysFalse()) {
if (join != null) {
join.reset();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论