Skip to content
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

ui,sql: add Vectorized info to statements page #50255

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

yuzefovich
Copy link
Member

This commit adds a box to Statements page that displays whether the
vectorized execution engine is used.

Release note (admin ui change): Statements page now contains information
about which execution engine is used (vectorized or not).

@yuzefovich yuzefovich requested review from koorosh, RaduBerinde and a team June 16, 2020 04:47
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@awoods187
Copy link
Contributor

Thanks for jumping on this! Do you have a screenshot of what this will look like?

@yuzefovich
Copy link
Member Author

Yes, I do (of the relevant section). I made the screenshot yesterday but forgot to add it here. Let me know if you're interested in the shot of the whole screen.
Screen Shot 2020-06-15 at 9 46 06 PM

@awoods187
Copy link
Contributor

Thanks for sharing! What does 1 of 2 mean?

@yuzefovich
Copy link
Member Author

It is the same as for Distributed execution: we represent that information as a "fraction", so 1 of 2 means that out of two times the query was executed, it ran once via the vectorized engine and once via the old engine. In edge cases we show the words: "no" if we have 0 out of any number of runs, and "yes" if the numerator of the "fraction" equals the denominator.

@awoods187
Copy link
Contributor

Gotcha. I predict that it will be confusing to the user why the query fingerprint is sometimes run in vectorized and sometime not.

In fact, why would that be the case? Is this an indication that we shouldn't actually be grouping these two queries under the same fingerprint?

@yuzefovich
Copy link
Member Author

yuzefovich commented Jun 16, 2020

I predict that it will be confusing to the user why the query fingerprint is sometimes run in vectorized and sometime not.

Yeah, it might be confusing, but we use the exactly same representation for "Distributed execution" (as well as for "Used cost-based optimizer" but this one is now always yes), so I think it is something for UI team to look at.

In fact, why would that be the case?

In my scenario I explicitly changed vectorize setting manually. The users will probably not be doing that, so they will see either "no" or "yes". There is, however, a scenario when the user might see "no vectorization" for short period of time (while table statistics haven't been collected) which switches to "used vectorization" (because we rely on statistics to make a decision whether to vectorize or not, and if stats are not present, we do not vectorize).

Is this an indication that we shouldn't actually be grouping these two queries under the same fingerprint?

I think the current grouping is reasonable, and I don't have a good feeling of what would be more preferable grouping criteria.

@awoods187
Copy link
Contributor

Alright, I opened up #50284 to discuss this further--don't let that conversation impact this PR.

Copy link
Collaborator

@koorosh koorosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (regarding UI changes)

Copy link
Contributor

@rohany rohany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stats related changes look fine

@@ -141,7 +143,7 @@ func (a *appStats) recordStatement(
}

// Get the statistics object.
s := a.getStatsForStmt(stmt, distSQLUsed, implicitTxn, err, true /* createIfNonexistent */)
s := a.getStatsForStmt(stmt, distSQLUsed, vectorized, implicitTxn, err, true /* createIfNonexistent */)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]: this is too long for one line now

}

return ctx, flow, nil
return ctx, flow, setupReq.EvalContext.Vectorize != int32(sessiondata.VectorizeOff), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we check here if the flow was vectorized or not? Why do we look at a setting

This commit adds a box to Statements page that displays whether the
vectorized execution engine is used.

Release note (admin ui change): Statements page now contains information
about which execution engine is used (vectorized or not).
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @RaduBerinde and @rohany)


pkg/sql/app_stats.go, line 146 at r1 (raw file):

Previously, rohany (Rohan Yadav) wrote…

[nit]: this is too long for one line now

Done.


pkg/sql/distsql_running.go, line 267 at r1 (raw file):

Previously, rohany (Rohan Yadav) wrote…

why don't we check here if the flow was vectorized or not? Why do we look at a setting

Indeed, good point, fixed.

@yuzefovich
Copy link
Member Author

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 23, 2020

Build succeeded

@craig craig bot merged commit 60ecb57 into cockroachdb:master Jun 23, 2020
@yuzefovich yuzefovich deleted the vectorized-ui branch June 23, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants