提交 b02a17af authored 作者: S.Vladykin's avatar S.Vladykin

minor

上级 68032a31
...@@ -368,7 +368,6 @@ public class TableFilter implements ColumnResolver { ...@@ -368,7 +368,6 @@ public class TableFilter implements ColumnResolver {
public JoinBatch prepareJoinBatch(JoinBatch jb, TableFilter[] filters, int filter) { public JoinBatch prepareJoinBatch(JoinBatch jb, TableFilter[] filters, int filter) {
joinBatch = null; joinBatch = null;
joinFilterId = -1; joinFilterId = -1;
IndexLookupBatch lookupBatch = null;
if (getTable().isView()) { if (getTable().isView()) {
session.pushSubQueryInfo(masks, filters, filter, select.getSortOrder()); session.pushSubQueryInfo(masks, filters, filter, select.getSortOrder());
try { try {
...@@ -384,6 +383,7 @@ public class TableFilter implements ColumnResolver { ...@@ -384,6 +383,7 @@ public class TableFilter implements ColumnResolver {
// then we either not a top table filter or top table filter in a sub-query, which // then we either not a top table filter or top table filter in a sub-query, which
// in turn is not top in outer query, thus we need to enable batching here to allow // in turn is not top in outer query, thus we need to enable batching here to allow
// outer query run batched join against this sub-query. // outer query run batched join against this sub-query.
IndexLookupBatch lookupBatch = null;
if (jb == null && select != null && !isAlwaysTopTableFilter(filter)) { if (jb == null && select != null && !isAlwaysTopTableFilter(filter)) {
lookupBatch = index.createLookupBatch(this); lookupBatch = index.createLookupBatch(this);
if (lookupBatch != null) { if (lookupBatch != null) {
...@@ -396,18 +396,15 @@ public class TableFilter implements ColumnResolver { ...@@ -396,18 +396,15 @@ public class TableFilter implements ColumnResolver {
} }
joinBatch = jb; joinBatch = jb;
joinFilterId = filter; joinFilterId = filter;
if (lookupBatch == null) { if (lookupBatch == null && !isAlwaysTopTableFilter(filter)) {
boolean notTop = !isAlwaysTopTableFilter(filter);
if (notTop || getTable().isView()) {
// createLookupBatch will be called at most once because jb can be // createLookupBatch will be called at most once because jb can be
// created only if lookupBatch is already not null from the call above. // created only if lookupBatch is already not null from the call above.
lookupBatch = index.createLookupBatch(this); lookupBatch = index.createLookupBatch(this);
if (lookupBatch == null && notTop) { if (lookupBatch == null) {
// the index does not support lookup batching, need to fake it because we are not top // the index does not support lookup batching, need to fake it because we are not top
lookupBatch = JoinBatch.createFakeIndexLookupBatch(this); lookupBatch = JoinBatch.createFakeIndexLookupBatch(this);
} }
} }
}
jb.register(this, lookupBatch); jb.register(this, lookupBatch);
} }
return jb; return jb;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论