3 ms·
One approach is to create views for the required data and then just select the columns which are needed. The joins will be pruned by the query planner if they a
by rzmmm 1y ago
One approach is to create views for the required data and then just select the columns which are needed. The joins will be pruned by the query planner if they are not needed, so there is no need for conditional joins.
- hu3 1y ago> The joins will be pruned by the query planner if they are not needed, so there is no need for conditional joins. I always wondered about this. How reliable is that in your experience? Thank you in advance.
- derekperkins 1y agoDepends on the underlying database, and you'd have to test your query to have any level of certainty. That being said, query planning is generally where Oracle/MSSQl outshine MySQL/Postgres, especially for pruning unnecessary joins. BigQuery is great at it IME.
- banashark 1y agoYeah this definitely makes sense, and is good database API design as well.