public interface QueryHints
QueryHintScope
, which specifies the parts of the SPARQL query to
which it will be applied. A list of the common directives is declared by this
interface. (Query hints declared elsewhere are generally for internal use
only.) Note that not all query hints are permitted in all scopes.QueryHintScope
,
QueryHintRegistry
,
Clean up
query hints Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_PATH_SAMPLE_LIMIT
The #of samples to take when comparing the cost of a SCAN with an IN
filter to as-bound evaluation for each graph in the data set (default
100).
|
static String |
ACCESS_PATH_SCAN_AND_FILTER
For named and default graph access paths where access path cost
estimation is disabled by setting the
ACCESS_PATH_SAMPLE_LIMIT
to ZERO (0), this query hint determines whether a SCAN + FILTER or
PARALLEL SUBQUERY (aka as-bound data set join) approach. |
static String |
ANALYTIC
When
true , enables all query hints pertaining to analytic
query patterns. |
static String |
ANALYTIC_MAX_MEMORY_PER_QUERY
The maximum amount of native heap memory that may be allocated for a
single query when using the analytic query mode -or- ZERO (0L) if no
limit should be imposed.
|
static String |
AST_OPTIMIZER_CLASS
The name of the subclass derived from
ASTOptimizerList that will
be used to optimize SPARQL QUERY and UPDATE requests. |
static String |
AT_ONCE
Query hint indicating whether or not a JOIN (including SERVICE,
SUB-SELECT, etc) should be run as an "atOnce" operator.
|
static boolean |
CACHE_ENABLED
FIXME Hack enables the cache feature if the describe cache is enabled.
|
static String |
CHUNK_SIZE
Sets the target chunk size (aka vector size) for the output buffer of the operator.
|
static String |
CONSTRUCT_DISTINCT_SPO
Query hint for disabling the DISTINCT SPO behavior for a CONSTRUCT QUERY
(default true).
|
static String |
CUTOFF_LIMIT
Used to mark a statement pattern with a cutoff limit for how many
elements (maximum) should be read from its access path.
|
static int |
DEFAULT_ACCESS_PATH_SAMPLE_LIMIT
Note: Set to ZERO to disable AP sampling for default and named graphs.
|
static boolean |
DEFAULT_ACCESS_PATH_SCAN_AND_FILTER
Note: To ALWAYS use either SCAN + FILTER or PARALLEL subquery, set
DEFAULT_ACCESS_PATH_SAMPLE_LIMIT to ZERO (0) and set this to the
desired method for named graph and default graph evaluation. |
static boolean |
DEFAULT_ANALYTIC |
static long |
DEFAULT_ANALYTIC_MAX_MEMORY_PER_QUERY |
static String |
DEFAULT_AST_OPTIMIZER_CLASS |
static boolean |
DEFAULT_CONSTRUCT_DISTINCT_SPO |
static boolean |
DEFAULT_DEFAULT_GRAPH_DISTINCT_FILTER |
static boolean |
DEFAULT_DESCRIBE_CACHE |
static int |
DEFAULT_DESCRIBE_ITERATION_LIMIT |
static DescribeModeEnum |
DEFAULT_DESCRIBE_MODE |
static int |
DEFAULT_DESCRIBE_STATEMENT_LIMIT |
static boolean |
DEFAULT_DISTINCT_TERM_SCAN_OPTIMIZER |
static boolean |
DEFAULT_FAST_RANGE_COUNT_OPTIMIZER |
static FilterExistsModeEnum |
DEFAULT_FILTER_EXISTS
Note: The historical behavior up through bigdata release 1.3.1 is
FilterExistsModeEnum.VectoredSubPlan . |
static String |
DEFAULT_GRAPH_DISTINCT_FILTER
By default, a DISTINCT filter is applied when evaluating access paths
against the default graph, for correctness reasons.
|
static boolean |
DEFAULT_HASH_JOIN |
static boolean |
DEFAULT_MERGE_JOIN |
static boolean |
DEFAULT_NATIVE_DISTINCT_SOLUTIONS |
static boolean |
DEFAULT_NATIVE_DISTINCT_SPO |
static long |
DEFAULT_NATIVE_DISTINCT_SPO_THRESHOLD |
static boolean |
DEFAULT_NATIVE_HASH_JOINS |
static boolean |
DEFAULT_NORMALIZE_FILTER_EXPRESSIONS |
static boolean |
DEFAULT_OLD_JOIN_ORDER_OPTIMIZER |
static double |
DEFAULT_OPTIMISTIC |
static QueryOptimizerEnum |
DEFAULT_OPTIMIZER |
static boolean |
DEFAULT_PIPELINED_HASH_JOIN |
static IChunkHandler |
DEFAULT_QUERY_ENGINE_CHUNK_HANDLER |
static boolean |
DEFAULT_REGEX_MATCH_NON_STRING |
static boolean |
DEFAULT_REIFICATION_DONE_RIGHT |
static boolean |
DEFAULT_REMOTE_APS |
static int |
DEFAULT_RTO_LIMIT |
static int |
DEFAULT_RTO_NEDGES |
static SampleIndex.SampleType |
DEFAULT_RTO_SAMPLE_TYPE |
static String |
DESCRIBE_CACHE
When
true a DESCRIBE cache will be maintained. |
static String |
DESCRIBE_ITERATION_LIMIT
For iterative
DescribeModeEnum s, this property places a limit on
the number of iterative expansions that will be performed before the
DESCRIBE query is cut off, providing that the limit on the maximum #of
statements in the description is also satisfied (the cut off requires
that both limits are reached). |
static String |
DESCRIBE_MODE
Query hint controls the manner in which a DESCRIBE query is evaluated.
|
static String |
DESCRIBE_STATEMENT_LIMIT
For iterative
DescribeModeEnum s, this property places a limit on
the number of statements that will be accumulated before the DESCRIBE
query is cut off, providing that the limit on the maximum #of iterations
in the description is also satisfied (the cut off requires that both
limits are reached). |
static String |
DISTINCT_TERM_SCAN_OPTIMIZER
The name of an property that may be used to enable or disable the
ASTDistinctTermScanOptimizer . |
static String |
FAST_RANGE_COUNT_OPTIMIZER
The name of an property that may be used to enable or disable the
ASTFastRangeCountOptimizer . |
static String |
FILTER_EXISTS
Used to specify the query plan for FILTER (NOT) EXISTS.
|
static String |
GEARING
https://jira.blazegraph.com/browse/BLZG-2089
Hint that allows to choose the gearing that is used for evaluating
property paths. |
static String |
GEARING_FORWARD |
static String |
GEARING_REVERSE |
static String |
HASH_JOIN
Query hint to use a hash join against the access path for a given
predicate.
|
static String |
HISTORY
Used to mark a predicate for historical read.
|
static String |
MAX_PARALLEL
The maximum parallelism for the operator within the query.
|
static String |
MERGE_JOIN
When
true , a merge-join pattern will be recognized if it
appears in a join group. |
static String |
NAMESPACE
The namespace for the bigdata query hints.
|
static String |
NATIVE_DISTINCT_SOLUTIONS
When
true , will use the version of DISTINCT SOLUTIONS based
on the HTree and the native (C process) heap. |
static String |
NATIVE_DISTINCT_SPO
When
true and the range count of the default graph access
path exceeds the NATIVE_DISTINCT_SPO_THRESHOLD , will use the
version of DISTINCT SPO for a hash join against a DEFAULT GRAPH access
path based on the HTree and the native (C process) heap. |
static String |
NATIVE_DISTINCT_SPO_THRESHOLD
The minimum range count for a default graph access path before the native
DISTINCT SPO filter will be used.
|
static String |
NATIVE_HASH_JOINS
When
true , use hash index operations based on the
HTree and backed by the native (C process) heap. |
static String |
NORMALIZE_FILTER_EXPRESSIONS
Switch to disable normalization/decomposition of FILTER expressions.
|
static String |
OLD_JOIN_ORDER_OPTIMIZER
Switch to re-enable old,
ASTJoinOrderByTypeOptimizer (which was
the predecessor of the ASTJoinGroupOrderOptimizer . |
static String |
OPTIMISTIC
Query hint sets the optimistic threshold for the static join order
optimizer.
|
static String |
OPTIMIZER
Specify the join order optimizer.
|
static String |
PIPELINED_HASH_JOIN
Prefer pipelined hash join over its normal, non-pipelined variant.
|
static String |
QUERY_ENGINE_CHUNK_HANDLER
Controls where the intermediate solutions output by operators will be
stored.
|
static String |
QUERYID
The
UUID to be assigned to the IRunningQuery (optional). |
static String |
RANGE_SAFE
Used to mark a predicate as "range safe" - that is, we can safely
apply the range bop to constrain the predicate.
|
static String |
REGEX_MATCH_NON_STRING
https://jira.blazegraph.com/browse/BLZG-1200
https://www.w3.org/TR/sparql11-query/#func-regex
https://www.w3.org/TR/sparql11-query/#restrictString
By default, regex is only applied to Literal String values. |
static String |
REIFICATION_DONE_RIGHT
Option controls whether or not the proposed SPARQL extension for
reification done right is enabled.
|
static String |
REMOTE_APS
When
true , force the use of REMOTE access paths in scale-out
joins. |
static String |
RTO_LIMIT
The limit for sampling a vertex and the initial limit for cutoff join
evaluation (default 100).
|
static String |
RTO_NEDGES
The nedges edges of the join graph having the lowest cardinality
will be used to generate the initial join paths (default
).
|
static String |
RTO_SAMPLE_TYPE
The sampling bias for the runtime query optimizer.
|
static String |
RUN_FIRST
This query hint may be applied to any
IJoinNode and marks a
particular join to be run first among in a particular group. |
static String |
RUN_LAST
This query hint may be applied to any
IJoinNode and marks a
particular join to be run last among in a particular group. |
static String |
RUN_ONCE
Query hint indicating whether or not a Sub-Select should be transformed
into a named subquery, lifting its evaluation out of the main
body of the query and replacing the subquery with an INCLUDE.
|
static final String NAMESPACE
static final String OPTIMIZER
hint:Group hint:optimizer "None".Disabling the join order optimizer can be useful if you have a query for which the static optimizer is producing a inefficient join ordering. With the query optimizer disabled for that query, the joins will be run in the order given. This makes it possible for you to decide on the right join ordering for that query.
QueryOptimizerEnum
,
Constant Field Valuesstatic final QueryOptimizerEnum DEFAULT_OPTIMIZER
static final String RTO_SAMPLE_TYPE
SampleIndex.SampleType
,
Constant Field Valuesstatic final SampleIndex.SampleType DEFAULT_RTO_SAMPLE_TYPE
static final String RTO_LIMIT
static final int DEFAULT_RTO_LIMIT
static final String RTO_NEDGES
static final int DEFAULT_RTO_NEDGES
static final String OPTIMISTIC
static final double DEFAULT_OPTIMISTIC
static final String ANALYTIC
true
, enables all query hints pertaining to analytic
query patterns. When false
, those features are disabled.
Note: This query hint MUST be applied in the QueryHintScope.Query
. Hash indices are often created by one operator and then consumed by
another so the same kinds of hash indices MUST be used throughout the
query.
hint:Query hint:analytic "true".The default is
false
. The default may be
overridden using the environment variable named
com.bigdata.rdf.sparql.ast.QueryHints.analytic
static final boolean DEFAULT_ANALYTIC
static final String ANALYTIC_MAX_MEMORY_PER_QUERY
The default is ZERO (0) which implies no limit. The default may be overridden using the environment variable named
com.bigdata.rdf.sparql.ast.QueryHints.analyticMaxMemoryPerQuery
Native memory allocations are made using a DirectBufferPool
. The
per-query limit will be rounded up to a multiple of buffers based on the
configured buffer capacity. The default is a 1MB buffer, so the
granularity of the limit is multiples of 1MB.
static final long DEFAULT_ANALYTIC_MAX_MEMORY_PER_QUERY
static final String QUERY_ENGINE_CHUNK_HANDLER
The effective value of this property is determined by effective value of the system property "queryEngineChunkHandler".
Vector query engine on native heap.
,
Constant Field Valuesstatic final IChunkHandler DEFAULT_QUERY_ENGINE_CHUNK_HANDLER
static final String NATIVE_DISTINCT_SOLUTIONS
true
, will use the version of DISTINCT SOLUTIONS based
on the HTree
and the native (C process) heap. When
false
, use the version based on a JVM collection class. The
JVM version does not scale-up as well, but it offers higher concurrency.static final boolean DEFAULT_NATIVE_DISTINCT_SOLUTIONS
static final String NATIVE_DISTINCT_SPO
true
and the range count of the default graph access
path exceeds the NATIVE_DISTINCT_SPO_THRESHOLD
, will use the
version of DISTINCT SPO for a hash join against a DEFAULT GRAPH access
path based on the HTree
and the native (C process) heap. When
false
, use the version based on a JVM collection class. The
JVM version does not scale-up as well.static final boolean DEFAULT_NATIVE_DISTINCT_SPO
static final String NATIVE_DISTINCT_SPO_THRESHOLD
NATIVE_DISTINCT_SPO
,
Constant Field Valuesstatic final long DEFAULT_NATIVE_DISTINCT_SPO_THRESHOLD
static final String NATIVE_HASH_JOINS
true
, use hash index operations based on the
HTree
and backed by the native (C process) heap. When
false
, use hash index operations based on the Java
collection classes. The HTree
is more scalable but has higher
overhead for small cardinality hash joins.
Note: This query hint MUST be applied in the QueryHintScope.Query
. Hash indices are often created by one operator and then consumed by
another so the same kinds of hash indices MUST be used throughout the
query.
static final boolean DEFAULT_NATIVE_HASH_JOINS
static final String MERGE_JOIN
true
, a merge-join pattern will be recognized if it
appears in a join group. When false
, this can still be
selectively enabled using a query hint.static final boolean DEFAULT_MERGE_JOIN
static final String CONSTRUCT_DISTINCT_SPO
ANALYTIC
query hint to use the native heap for the
DISTINCT SPO filter. Thus this query hint is really only for very large
graphs.(performance of dumping
single graph)
,
Constant Field Valuesstatic final boolean DEFAULT_CONSTRUCT_DISTINCT_SPO
static final String REMOTE_APS
true
, force the use of REMOTE access paths in scale-out
joins. This is intended as a tool when analyzing query patterns in
scale-out. It should normally be false
.static final boolean DEFAULT_REMOTE_APS
https://sourceforge.net/apps/trac/bigdata/ticket/380#comment:4
,
Constant Field Valuesstatic final String ACCESS_PATH_SAMPLE_LIMIT
When ZERO (0), no cost estimation will be performed and the named graph
or default graph join will always use approach specified by the boolean
ACCESS_PATH_SCAN_AND_FILTER
.
static final int DEFAULT_ACCESS_PATH_SAMPLE_LIMIT
static final String ACCESS_PATH_SCAN_AND_FILTER
ACCESS_PATH_SAMPLE_LIMIT
to ZERO (0), this query hint determines whether a SCAN + FILTER or
PARALLEL SUBQUERY (aka as-bound data set join) approach.static final boolean DEFAULT_ACCESS_PATH_SCAN_AND_FILTER
DEFAULT_ACCESS_PATH_SAMPLE_LIMIT
to ZERO (0) and set this to the
desired method for named graph and default graph evaluation. Note that
you MAY still override this behavior within a given scope using a query
hint.static final String QUERYID
UUID
to be assigned to the IRunningQuery
(optional).
This query hint makes it possible for the application to assign the
UUID
under which the query will run. This can be used to locate
the IRunningQuery
using its UUID
and gather metadata
about the query during its evaluation. The IRunningQuery
may be
used to monitor the query or even cancel a query.
The UUID
of each query MUST be distinct. When using this query
hint the application assumes responsibility for applying
UUID.randomUUID()
to generate a unique UUID
for the
query. The application may then discover the IRunningQuery
using
QueryEngineFactory#getQueryController(com.bigdata.journal.IIndexManager)
and QueryEngine.getQuery(UUID)
.
Note: The openrdf iteration interface has a close() method, but this can
not be invoked until hasNext() has run and the first solution has been
materialized. For queries which use an "at-once" operator, such as ORDER
BY, the query will run to completion before hasNext() returns. This means
that it is effectively impossible to interrupt a running query which uses
an ORDER BY clause from the SAIL. However, applications MAY use this
query hint to discovery the IRunningQuery
interface and cancel
the query.
hint:Query hint:queryId "36cff615-aaea-418a-bb47-006699702e45"
https://sourceforge.net/apps/trac/bigdata/ticket/283
,
Constant Field Valuesstatic final String RUN_FIRST
IJoinNode
and marks a
particular join to be run first among in a particular group. Only one
"run first" join is permitted in a given group. This query hint is not
permitted on optional joins. This hint must be used with
QueryHintScope.Prior
.static final String RUN_LAST
IJoinNode
and marks a
particular join to be run last among in a particular group. Only one
"run last" join is permitted in a given group. This hint must be used
with QueryHintScope.Prior
.static final String RUN_ONCE
QueryHintScope.SubQuery
.
This is similar to 'atOnce'
evaluation, but creates a
different query plan by lifting out a named subquery. The
RUN_ONCE
query hint is only supported for
QueryHintScope.SubQuery
while AT_ONCE
query hint can be
applied to other things as well.
When true
, the subquery will be lifted out. When
false
, the subquery will not be lifted unless other
semantics require that it be lifted out regardless.
For example, the following may be used to lift out the sub-select in
which it appears into a NamedSubqueryRoot
. The lifted expression
will be executed exactly once.
hint:SubQuery hint:runOnce "true" .
AT_ONCE
,
Constant Field Valuesstatic final String AT_ONCE
Note: "atOnce" evaluation is a general property of the query engine. This
query hint does not change the structure of the query plan, but simply
serves as a directive to the query engine that it should buffer all
source solutions before running the operator. This is more general
purpose than the RUN_ONCE
query hint.
This query hint is allowed in any scope. The hint is transferred as an annotation onto all query plan operators generated from the annotated scope.
TODO "Blocked" evaluation. Blocked evaluation is similar to at-once
evaluation but lacks the strong guarantee of that the operator will
run exactly once. For blocked evaluation, the solutions to be fed to
the operator are buffered up to a memory limit. If that memory limit
is reached, then the buffered solutions are vectored through the
operator. If all solutions can be buffered within the memory limit
then "at-once" and "blocked" evaluation amount to the same thing.
,
Constant Field Valuesstatic final String CHUNK_SIZE
This query hint does not change the structure of the query plan, but simply serves as a directive to the query engine that it should allocate an output buffer for the operator that will emit chunks of the indicated target capacity. This query hint is allowed in any scope, but is generally used to effect the behavior of a join group, a subquery, or the entire query.
static final String MAX_PARALLEL
Note: "maxParallel" evaluation is a general property of the query engine. This query hint does not change the structure of the query plan, but simply serves as a directive to the query engine that it should not allow more than the indicated number of parallel instances of the operator to execute concurrently. This query hint is allowed in any scope. The hint is transferred as an annotation onto all query plan operators generated from the annotated scope.
PipelineOp.Annotations#MAX_PARALLEL
,
Constant Field Valuesstatic final String HASH_JOIN
Note: HashJoinAnnotations.JOIN_VARS
MUST also be specified
for the predicate. The join variable(s) are variables which are (a)
bound by the predicate and (b) are known bound in the source
solutions. The query planner has the necessary context to figure this
out based on the structure of the query plan and the join evaluation
order.
static final boolean DEFAULT_HASH_JOIN
static final String DESCRIBE_CACHE
true
a DESCRIBE cache will be maintained. This can
accelerate DESCRIBE queries, linked data queries (which are mapped to a
DESCRIBE query by the NSS), and potentially accelerate star-joins (if the
query plan is rewritten to hit the DESCRIBE cache and obtain the
materialized joins from it, but this is best done with a fully
materialized and synchronously maintained DESCRIBE cache).static final boolean DEFAULT_DESCRIBE_CACHE
static final boolean CACHE_ENABLED
static final String DESCRIBE_MODE
static final DescribeModeEnum DEFAULT_DESCRIBE_MODE
static final String DESCRIBE_ITERATION_LIMIT
DescribeModeEnum
s, this property places a limit on
the number of iterative expansions that will be performed before the
DESCRIBE query is cut off, providing that the limit on the maximum #of
statements in the description is also satisfied (the cut off requires
that both limits are reached). May be ZERO (0) for NO limit.static final int DEFAULT_DESCRIBE_ITERATION_LIMIT
static final String DESCRIBE_STATEMENT_LIMIT
DescribeModeEnum
s, this property places a limit on
the number of statements that will be accumulated before the DESCRIBE
query is cut off, providing that the limit on the maximum #of iterations
in the description is also satisfied (the cut off requires that both
limits are reached). May be ZERO (0) for NO limit.static final int DEFAULT_DESCRIBE_STATEMENT_LIMIT
static final String REIFICATION_DONE_RIGHT
static final boolean DEFAULT_REIFICATION_DONE_RIGHT
static final String RANGE_SAFE
static final String CUTOFF_LIMIT
JoinAnnotations.LIMIT
,
Constant Field Valuesstatic final String FILTER_EXISTS
static final FilterExistsModeEnum DEFAULT_FILTER_EXISTS
FilterExistsModeEnum.VectoredSubPlan
.static final String FAST_RANGE_COUNT_OPTIMIZER
ASTFastRangeCountOptimizer
.static final boolean DEFAULT_FAST_RANGE_COUNT_OPTIMIZER
static final String DISTINCT_TERM_SCAN_OPTIMIZER
ASTDistinctTermScanOptimizer
.static final boolean DEFAULT_DISTINCT_TERM_SCAN_OPTIMIZER
static final String AST_OPTIMIZER_CLASS
ASTOptimizerList
that will
be used to optimize SPARQL QUERY and UPDATE requests. This class MUST
implement a public zero argument constructor.static final String DEFAULT_AST_OPTIMIZER_CLASS
static final String OLD_JOIN_ORDER_OPTIMIZER
ASTJoinOrderByTypeOptimizer
(which was
the predecessor of the ASTJoinGroupOrderOptimizer
. By default,
the new strategy is enabled.static final String HISTORY
static final boolean DEFAULT_OLD_JOIN_ORDER_OPTIMIZER
static final String NORMALIZE_FILTER_EXPRESSIONS
static final boolean DEFAULT_NORMALIZE_FILTER_EXPRESSIONS
static final String PIPELINED_HASH_JOIN
static final boolean DEFAULT_PIPELINED_HASH_JOIN
static final String DEFAULT_GRAPH_DISTINCT_FILTER
static final boolean DEFAULT_DEFAULT_GRAPH_DISTINCT_FILTER
static final String REGEX_MATCH_NON_STRING
https://jira.blazegraph.com/browse/BLZG-1200
https://www.w3.org/TR/sparql11-query/#func-regex
https://www.w3.org/TR/sparql11-query/#restrictString
By default, regex is only applied to Literal String values. Enabling this
query hint will attempt to autoconvert non-String literals into their
string value. This is the equivalent of always using the str(...) function.static final boolean DEFAULT_REGEX_MATCH_NON_STRING
static final String GEARING
https://jira.blazegraph.com/browse/BLZG-2089
Hint that allows to choose the gearing that is used for evaluating
property paths. Possible values are:
- auto: let the optimizer choose (this is the default)
- forward: choose forward gearing, i.e. start out with the subject
- reverse: choose backward gearing, i.e. start out with the objectstatic final String GEARING_FORWARD
static final String GEARING_REVERSE
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.