Help optimizing query
Thanks all for the help. Yes, this is a bunch of UNIONS, and I figured my indexes weren't helping. I am going to see what I can to mitigate the UNIONs and also I'm going to go back and try to filter...
View ArticleHelp optimizing query
I scanned through the monster queries and looked at the DDL.Typically, using DISTINCT and/or UNION (which implies DISTINCT) is ofter very expensive, and most of the time not needed. If there are...
View ArticleHelp optimizing query
UNION SELECT DISTINCT I noticed this part, I don't think you require distinct in the individual query levels as the union will remove the duplicates. If the queries participating in union returns a...
View ArticleHelp optimizing query
Again, I didn't look close, but I started from the very top query now.First of all, using DISTINCT often indicates a problem in the data. I think you may want to drop DISTINCT and see if the result...
View ArticleHelp optimizing query
I didn't look into the monster in details, but one thing caught my attention:This partWHERE Tag = 'Expired Compact License' AND NOT EXISTS (SELECT 1 FROM TravelerOrderReportMatching WHERE Tag = 'Worked...
View ArticleHelp optimizing query
Good point!! Let me change it up and see how much that cuts it down. Still looking for maybe some help with the MATCHING query time if someone gets a chance. Thank you Naomi
View ArticleHelp optimizing query
I didn't look into the monster in details, but one thing caught my attention:This partWHERE Tag = 'Expired Compact License' AND NOT EXISTS (SELECT 1 FROM TravelerOrderReportMatching WHERE Tag = 'Worked...
View ArticleHelp optimizing query
I have quite a complex query that is used to match up certain people to orders (jobs). The problem is all the data that needs to be collected from various tables, and I've tried to consolidate the...
View Article
More Pages to Explore .....