-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve task archiver query performance #5088
Conversation
@yuyiguo, @hufnagel However,
In this case (which is major bottle neck) I can't replace that to wmbs.job == NULL, I think it might be better break down the query at least 3 parts. (for more clear step) But for now I will leave as it is. Seangchan |
It is hard for me to really examine the code w/o seeing the DB schema and the data in the DB. Just comparing the revised sql with thw current sql, it seems to me that the revised is better written. The one thing I observed is that completeNonJobSQL and subWithUnfinishedJobSQL have most of the comment query. If we can create temporary static table using the common part of the query, then subWithUnfinishedJobSQL do additional select from that table . Then we can select from t1 w/o repeating the same query. |
Thanks Yuyi, I didn't know we could to that. That is a good tip. In the performance wise, newer query is much faster. Most concern for me is the correctness of the query. Whether both query gives the same result in all the cases. Let's talk tomorrow, Dirk will be here as well. |
Hi Yuyi,
|
improve task archiver query performance
fixes #4865