use of org.voltdb.plannodes.IndexCountPlanNode in project voltdb by VoltDB.
the class TestIndexSelection method checkIndexSkipNullPredicateIsNull.
private void checkIndexSkipNullPredicateIsNull(AbstractPlanNode pn, boolean hasSkipNullPredicate) {
assertEquals(1, pn.getChildCount());
pn = pn.getChild(0);
if (pn instanceof IndexCountPlanNode) {
assertEquals(hasSkipNullPredicate, ((IndexCountPlanNode) pn).hasSkipNullPredicate());
} else {
// index scan
AbstractExpression skipNull = ((IndexScanPlanNode) pn).getSkipNullPredicate();
assertEquals(hasSkipNullPredicate, skipNull != null);
}
}
use of org.voltdb.plannodes.IndexCountPlanNode in project voltdb by VoltDB.
the class TestIndexSelection method checkCountUsesIndex.
private void checkCountUsesIndex(AbstractPlanNode pn, String targetIndexName) {
assertEquals(1, pn.getChildCount());
pn = pn.getChild(0);
assertEquals(PlanNodeType.INDEXCOUNT, pn.getPlanNodeType());
IndexCountPlanNode icpn = (IndexCountPlanNode) pn;
assertTrue(icpn.hasTargetIndexName(targetIndexName));
}
use of org.voltdb.plannodes.IndexCountPlanNode in project voltdb by VoltDB.
the class CompiledPlan method boundParamIndexes.
/// Extract a sorted de-duped vector of all the bound parameter indexes in a plan. Or null if none.
public int[] boundParamIndexes() {
if (parameters.length == 0) {
return null;
}
BitSet ints = new BitSet();
ArrayList<AbstractPlanNode> ixscans = rootPlanGraph.findAllNodesOfType(PlanNodeType.INDEXSCAN);
if (subPlanGraph != null) {
ixscans.addAll(subPlanGraph.findAllNodesOfType(PlanNodeType.INDEXSCAN));
}
for (AbstractPlanNode apn : ixscans) {
assert (apn instanceof IndexScanPlanNode);
IndexScanPlanNode ixs = (IndexScanPlanNode) apn;
setParamIndexes(ints, ixs.getBindings());
}
ArrayList<AbstractPlanNode> ixcounts = rootPlanGraph.findAllNodesOfType(PlanNodeType.INDEXCOUNT);
if (subPlanGraph != null) {
ixcounts.addAll(subPlanGraph.findAllNodesOfType(PlanNodeType.INDEXCOUNT));
}
for (AbstractPlanNode apn : ixcounts) {
assert (apn instanceof IndexCountPlanNode);
IndexCountPlanNode ixc = (IndexCountPlanNode) apn;
setParamIndexes(ints, ixc.getBindings());
}
return bitSetToIntVector(ints);
}
Aggregations