6.9. Query Properties¶
GeoMesa provides advanced query capabilities through GeoTools query hints. You can use these hints to control various aspects of query processing, or to trigger distributed analytic processing.
6.9.1. Setting Query Hints¶
Query hints can be set in two ways - programmatically or through GeoServer requests.
188.8.131.52. Programmatic Hints¶
To set a hint directly in a query:
import org.geotools.data.Query; Query query = new Query("typeName"); query.getHints().put(key, value);
Note that query hint values must match the class type of the query hint. See below for available hints and their types.
184.108.40.206. GeoServer Hints¶
To set a hint through GeoServer, modify your query URL to use the
viewparams request parameter:
Hint values will be converted into the appropriate types. See below for available hints and their accepted values.
220.127.116.11. Command-Line Tools¶
When exporting features through the GeoMesa command line tools, query hints can be set using the
Hints should be specified in the form
key1=value1;key2=value2. Hints are converted to the appropriate type
according to the conventions for GeoServer hints.
6.9.2. Loose Bounding Box¶
By default, GeoMesa uses a less precise filter for primary bounding box queries. This is faster, and in most cases will not change the results returned. However, certain use-cases require an exact result. This can be set at the data store configuration level, or overridden per query.
6.9.3. Exact Counts¶
By default, GeoMesa uses an estimate for counts. In certain cases, users may require exact counts. This may
be set through the system property
geomesa.force.count or per query. Note, however, that exact counts
are expensive to calculate.
6.9.4. Query Index¶
GeoMesa may be able to use several different indices to satisfy a particular query. For example, a query with a spatial filter and an attribute filter could potentially use either the primary spatial index or the attribute index. GeoMesa uses cost-based query planning to pick the best index; however, the index can be overridden if desired.
||index name, or name:version|
For more details, see Query Planning.
6.9.5. Query Planning Type¶
As explained above, GeoMesa uses cost-based query planning to determine the best index for a given query.
If cost-based query planning is not working as desired, the legacy heuristic-based query
planning can be used as a fall-back.
Stats uses cost-based planning;
Index uses heuristic-based planning.
Query planning can also be controlled through the system property
Runtime Configuration for details. If both a query hint and a system property are set, the query hint will
See Query Planning for more information on query planning strategies.