Description
As Trino becomes more and more complex, it's hard to provide a one-size-fits-all experience for different kinds of workloads and query shapes. Trino provides many useful configuration options, but they either have to be stored in static config files or configured at the session level. Moreover, for specific query tuning needs, Trino currently does not provide a way to specify the join strategy for one specific join node or the overall join order for a single query. I understand the CBO work helps Trino make better query plans by itself, but it happens that the query plan is suboptimal and we want to fine tune certain parts of the query planning due to lack of statistics, inaccurate estimation etc.
Many major databases provide the query hints feature: Oracle, SQL Server, MySQL, and even Spark SQL. Trino should also consider having equivalent functionalities to provide seasoned users better ways to work with the query engine.
Someone else also brought this up previously: #1261