public class ASTFastRangeCountOptimizer extends Object implements IASTOptimizer
SELECT COUNT(DISTINCT *) {?s ?p ?o}
SELECT COUNT(REDUCED *) {?s ?p ?o}
SELECT COUNT(*) {?s ?p ?o}
Combinations using a constrained range-count.
SELECT COUNT(*) {:s ?p ?o}
SELECT COUNT(*) {?s :p ?o}
SELECT COUNT(*) {?s ?p :o}
SELECT COUNT(*) {:s ?p :o}
Combinations using a constrained range-count where the triple pattern is
1-unbound and the COUNT() references the unbound variable.
SELECT COUNT(?s) {?s :p :o}
SELECT COUNT(?p) {:s ?p :o}
SELECT COUNT(?o) {:s :p ?o}
Combinations using a constrained range-count with a QUADS mode access path.
SELECT COUNT(*) { GRAPH ?g {?s ?p ?o} }
SELECT COUNT(*) { GRAPH :g {:s ?p ?o} }
Combinations using a constrained range-count with a QUADS mode access path
where the triple pattern is 1-unbound and the COUNT() references the unbound variable.
SELECT COUNT(?s) { GRAPH :g {?s :p :o} }
SELECT COUNT(?g) { GRAPH ?g {:s :p :o} }
Combinations using a sub-select with nothing projected in:
SELECT * { { SELECT COUNT(*) {?s ?p ?o} } }
SELECT * { { SELECT COUNT(*) {?s ?p ?o} } :s :p :o .}
Combinations using a sub-select with something projected in:
SELECT * { ?s a :b . { SELECT COUNT(*) {?s ?p ?o} .}
ASTDistinctTermScanOptimizer instead:
SELECT COUNT(?p) {:s ?p ?o}
SELECT COUNT(DISTINCT ?p) {:s ?p ?o}
SELECT COUNT(REDUCED ?p) {:s ?p ?o}
Sub-select that would be handled as a distinct term scan with something
projected in.
SELECT * { ?s a :b . { SELECT COUNT(?p) {?s ?p ?o} .}| Constructor and Description |
|---|
ASTFastRangeCountOptimizer() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
markForFastRangeCount(AST2BOpContext context,
StatementPatternNode sp,
VarNode fastRangeCountVariable)
Marks the triple pattern for fast range count, if supported.
|
QueryNodeWithBindingSet |
optimize(AST2BOpContext context,
QueryNodeWithBindingSet input)
Optimize the AST.
|
public QueryNodeWithBindingSet optimize(AST2BOpContext context, QueryNodeWithBindingSet input)
IASTOptimizeroptimize in interface IASTOptimizercontext - The evaluation context.input - The input to the optimizer, consisting of a queryNode and
input binding set.protected boolean markForFastRangeCount(AST2BOpContext context, StatementPatternNode sp, VarNode fastRangeCountVariable)
sp - fastRangeCountVariable - Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.