1. A method comprising: analyzing, by a processor of a computing device, a query submitted to a database to determine a join order restriction that is associated with a join between two tables of a plurality of tables of the database that participate in the query, the join order restriction constraining its associated join to be executed prior to another join of the query, wherein analyzing the query to determine the join order restriction comprises: determining a join order that produces a different result than a result obtained by executing the query according to a join order semantically expressed in the query; and constructing the join order restriction to exclude the determined join order that produces the different result, from join plans for executing the query; assigning a ranking of priority to each join between tables that participate in the query based on the join order restriction, including assigning a join associated with the join order restriction a lower priority than other joins in the query, wherein a join that was assigned a higher priority is executed prior to a join that was assigned a lower priority; generating the join plans for executing the query constrained by the join order restriction, the join plans including different join orders; selecting a join plan from the join plans for execution of the query; and executing, by the processor, the query based on the selected join plan.