Thank you for the tip at 3:42 about checking all columns from the joined tables to see where values differ. I have been plagued with unexplained duplicate rows and would use DISTINCT or UNION (as opposed to UNION ALL) as a coverup, but it never sat right with me to do that. I can't wait to try out your suggestion!
I’m sorry, how is this helpful? You’ve initially had a query where not all the joins were necessary and then you have essentially removed the unnecessary joins to reduce costs. What was causing the cost in the first place was a poor query. There is no inherent optimization on how the data is being pulled.
Thanks for the feedback. That's the point of the video - there are sometimes changes you can make to remove things from the query that aren't necessary, which improves performance.
Got it! Thank you for explaining. And if the goal is to warn users to check their queries before running, that makes total sense. I think I was misled by the title, assuming that there are some inherent changes you can make to the queries/joins or re-writing them in a particular order to get the same results but lower costs. Thank you for clarifying.
Thank you for the tip at 3:42 about checking all columns from the joined tables to see where values differ. I have been plagued with unexplained duplicate rows and would use DISTINCT or UNION (as opposed to UNION ALL) as a coverup, but it never sat right with me to do that. I can't wait to try out your suggestion!
Glad to hear it helped! It's a helpful tip and I hope you can try it out soon.
Thank you for this very useful video!
Glad it was helpful!
Your suggestion here is to check any query where distinct is involved?
I think a list of critical/suspicious instructions will be great!
Thank you!
Yeah that's right. Sometimes the distinct keyword is necessary, but sometimes it's not needed and is hiding another issue.
I’m sorry, how is this helpful? You’ve initially had a query where not all the joins were necessary and then you have essentially removed the unnecessary joins to reduce costs. What was causing the cost in the first place was a poor query. There is no inherent optimization on how the data is being pulled.
Thanks for the feedback. That's the point of the video - there are sometimes changes you can make to remove things from the query that aren't necessary, which improves performance.
Got it! Thank you for explaining. And if the goal is to warn users to check their queries before running, that makes total sense. I think I was misled by the title, assuming that there are some inherent changes you can make to the queries/joins or re-writing them in a particular order to get the same results but lower costs. Thank you for clarifying.