Dear All
My database employs an extremely long and complicated union query, which is only going to get longer and more complicated. It struck me today that all of the 30-ish select statements in the query share one common WHERE clause. Would that union query run more quickly if I based it on another query whose only job was to run that single WHERE statement (thus significantly reducing the dataset before running the union query) or would the whole process still run at about the same speed?
Any other tips on improving the speed of queries?
Thanks in advance!
My database employs an extremely long and complicated union query, which is only going to get longer and more complicated. It struck me today that all of the 30-ish select statements in the query share one common WHERE clause. Would that union query run more quickly if I based it on another query whose only job was to run that single WHERE statement (thus significantly reducing the dataset before running the union query) or would the whole process still run at about the same speed?
Any other tips on improving the speed of queries?
Thanks in advance!