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

wip

上级 3c6ce034
......@@ -119,7 +119,8 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
// our sub-query itself is not batched, will run usual way
return null;
}
return joinBatch.getLookupBatch(0);
// TODO wrap the join batch into lookup batch
return null;
}
private IndexLookupBatch createLookupBatchUnion(SelectUnion union) {
......
......@@ -364,29 +364,33 @@ public class TableFilter implements ColumnResolver {
* @return join batch if query runs over index which supports batched lookups, {@code null} otherwise
*/
public JoinBatch prepareBatch(int id) {
JoinBatch batch = null;
joinBatch = null;
joinFilterId = -1;
JoinBatch jb = null;
if (join != null) {
batch = join.prepareBatch(id + 1);
jb = join.prepareBatch(id + 1);
}
IndexLookupBatch lookupBatch = null;
if (batch == null && select != null && !isAlwaysTopTableFilter(id)) {
// TODO review the !isAlwaysTopTableFilter condition
if (jb == null && select != null && !isAlwaysTopTableFilter(id)) {
lookupBatch = index.createLookupBatch(this);
if (lookupBatch != null) {
batch = new JoinBatch(id + 1, join);
jb = new JoinBatch(id + 1, join);
}
}
if (batch != null) {
if (jb != null) {
if (nestedJoin != null) {
throw DbException.getUnsupportedException("nested join with batched index");
}
joinBatch = batch;
joinBatch = jb;
joinFilterId = id;
// TODO review the !isAlwaysTopTableFilter condition
if (lookupBatch == null && !isAlwaysTopTableFilter(id)) {
lookupBatch = index.createLookupBatch(this);
}
batch.register(this, lookupBatch);
jb.register(this, lookupBatch);
}
return batch;
return jb;
}
public int getJoinFilterId() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论