-
Notifications
You must be signed in to change notification settings - Fork 898
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
remove count(*) from MiqQueue.get #14621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
take
it to the limit
!
@kbrock while this avoids the count, we can make it even more 🍨-y I suggest we keep The difference between
You changed the relation to the array, so we don't run the count. However (!) we don't need that So, I suggest, we just remove
and we are done. |
@isimluk great suggestion. |
85162d4
to
e3ff612
Compare
@kbrock could you please clean this one? I think it is new: ❗️ - Line 178, Col 8 - Style/TrailingWhitespace - Trailing whitespace detected. |
This pull request is not mergeable. Please rebase and repush. |
to avoid logging a nil, moved logging up a few lines
Checked commit kbrock@eb4d55d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
For
MiqQuery.get
, we perform an unneededCOUNT(*)
, which is almost as expensive as theSELECT *
This PR removes that
comments
before-4
after-2
TMI
I highlighted the count(*) which is present in before but not after
comments
count#before-2
.SELECT COUNT(count_column)
.SELECT "miq_queue".*
.SELECT "miq_workers".*
.BEGIN
.UPDATE "miq_queue" SET "state" = 'dequeue', "handler_id" = 10000000000018, "handler_type" = 'MiqServer', "updated_on" = .{28}, "lock_version" = 1
.COMMIT
It is nice that overall, the query numbers are pretty consistent
comments
before-1
before-2
before-3
before-4
comments
after-1
after-2
after-3
after-4