-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
expression, planner: support builtin function benchmark #9252
Conversation
implements builtin function `BENCHMARK()`, and introduces a counter in expression_rewriter to disable constant folding. (pingcap#6774)
Codecov Report
@@ Coverage Diff @@
## master #9252 +/- ##
==========================================
+ Coverage 67.15% 67.15% +<.01%
==========================================
Files 371 371
Lines 77427 77491 +64
==========================================
+ Hits 51995 52041 +46
- Misses 20785 20797 +12
- Partials 4647 4653 +6
Continue to review full report at Codecov.
|
@wuudjac Thanks for your contribution! |
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.
LGTM
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.
LGTM
/run-all-tests |
What problem does this PR solve?
Implements builtin function
BENCHMARK()
, and introduces a counter in expression_rewriter to disable constant folding. (#6774)What is changed and how it works?
BENCHMARK()
function.BENCHMARK()
scope,expressionRewriter.disableFoldCounter
is introduced.Check List
Tests
Execurtion time of these 3 commands should differ.
Code changes
builtinBenchmarkSig
in expression/builtin_info.goexpressionRewriter.disableFoldCounter
in planner/core/expression_rewriter.goexpressionRewriter.newFunction()
in planner/core/expression_rewriter.go to control new function behavior by the counter.Side effects
expressionRewriter.newFunction()
instead ofexpression.NewFunction()
, or this builtin function may not be available to be measured byBENCHMARK()
because of constant folding.Related changes