Hi,
In general, there are different [optimization techniques](https://community.denodo.com/kb/en/view/document/Best%20Practices%20to%20Maximize%20Performance%20II%3A%20Configuring%20the%20Query%20Optimizer) offered by Denodo to enhance the query performance.
If I have a query that uses multiple joins or union for its execution, then I would follow the below steps in order to optimize the query performance:
* Open the Virtual DataPort Administration Tool.
* Select the ``Server Configuration`` section, from the **Administration** menu.
* Navigate to the [Automatic Simplification of Queries](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/optimizing_queries/automatic_simplification_of_queries/automatic_simplification_of_queries#automatic-simplification-of-queries) option in the Queries Optimization tab.
* Now, click on the `On` radio button besides the Automatic Simplification of Queries option.
* Finally, save the configuration changes for the changes to get reflected.
Using the above option would automatically select the optimized query plan for the query being executed in Virtual DataPort.
For further information, please refer to the below documents,
* [Optimizing Join Operations](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/optimizing_queries/optimizing_join_operations/optimizing_join_operations), helps in using the suitable join method for optimizing the query.
* [Partitioned Unions](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/optimizing_queries/automatic_simplification_of_queries/removing_redundant_branches_of_queries_partitioned_unions) concept is used when the Execution Engine automatically identifies and removes the branch of a view from the query plan as it knows that no rows will be returned for that particular branch.
Hope it helps!