diff --git a/docs/how-to/query-options.md b/docs/how-to/query-options.md new file mode 100644 index 00000000000..3c2eac20de3 --- /dev/null +++ b/docs/how-to/query-options.md @@ -0,0 +1,87 @@ +# Query options + +Query options let a caller adjust selected query behavior for a connection or a +single request. They are not server-wide settings, execution/runtime controls, +or a way to configure the server's resource pools. + +## Supported options + +| Canonical option | SQL aliases | Values | +| --- | --- | --- | +| `query.parallelism` | `query_parallelism`, `query.parallelism` | Integer `1`–`1024`; server value `0` continues to mean automatic CPU-based parallelism. Sets the query's parallelism/partition bound, not a server resource-pool limit. | +| `query.allow_query_fallback` | `query_fallback`, `allow_query_fallback`, `query.allow_query_fallback` | `true` or `false` | +| `query.enable_remote_dynamic_filter_pushdown` | same | `true` or `false` | +| `datafusion.optimizer.*` | canonical name | Boolean, limited to: `repartition_joins`, `repartition_aggregations`, `repartition_sorts`, `repartition_windows`, `enable_round_robin_repartition`, `prefer_existing_sort`, `prefer_hash_join`, `join_reordering`, `enable_topk_aggregation`, `enable_dynamic_filter_pushdown` | + +For example: + +```sql +SET query_parallelism = 4; +SHOW VARIABLES query.parallelism; +SET query.allow_query_fallback = true; +SHOW VARIABLES query.allow_query_fallback; +SET datafusion.optimizer.repartition_joins = false; +``` + +`SHOW VARIABLES