Hints
Keyword |
flag |
Description |
Scenario |
Example |
---|---|---|---|---|
[HINT_LOCAL] |
[1] |
Obtains only the calculation results on the local server |
in a distributed cluster |
select [HINT_LOCAL] sum(*) from pt |
[HINT_HASH] |
[32] |
Groups data with the hash algorithm by default |
with a group by clause |
select [HINT_HASH] count(*) from t group by sym |
[HINT_SNAPSHO T] |
[64] |
Queries data from a snapshot engine of a DFS table |
when querying a snapshot engine registered with registerSnapshotEngine |
select [HINT_SNAPSHOT] * from loadTable(dbName,tableName) |
[HINT_KEEPORD ER] |
[128 ] |
Keeps the order of output records consistent with the input |
with a context by clause |
select [HINT_KEEPORDER] cumsu(vol) from t context by date, sym |
[HINT_SEQ] |
[512 ] |
Executes queries on partitions serially to save the concurrency overhead |
when memory is limited |
timer select [HINT_SEQ] avg(vol) from t |
[HINT_NOMERGE ] |
[102 4] |
Skips the merge step of intermediate results from map clause to improve the performance. Instead of returning the merged results in an in-memory table, only the handles of DFS tables are returned. |
when the intermediate results do not need to be returned |
select [HINT_NOMERGE] price from pt context by ticker |
[HINT_PRELOAD ] |
[409 6] |
Loads all data into memory before filtering with where-conditions |
with a where clause |
select [HINT_PRELOAD] sum(price) from t where volume > 100000 |
[HINT_EXPLAIN ] |
[327 68] |
Prints the query execution plan to monitor the real-time performance and execution order of a SQL query |
for SQL performance tuning. See [HINT_EXPLAIN] |
select [HINT_EXPLAIN] * from tb where id > 20 |
[HINT_SORT] |
[524 288] |
Applies sorting algorithm to data grouping |
with a group by clause |
select [HINT_SORT] avg(price) from trades group by sym |
[HINT_VECTORI ZED] |
[419 4304] |
Applies vectorization to data grouping |
with a group by clause |
select [HINT_VECTORIZED] sum(price) from trades group by sym |