-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Missing built-in benchmark function #6774
Comments
@morgo |
Say we have this query:
In tidb-server, the argument function will be constant folded by So, the query will be rewriten like this:
Making the evaluation of In mysql 5.7, the argument function is not constant folded, so the execurtion time differs, you can compare duration of these queries:
In order to make tidb-server behaves like mysql, I think constant folding needs to be turned off while visiting However, it may change many places where expression rewriter uses |
implements builtin function `BENCHMARK()`, and introduces a counter in expression_rewriter to disable constant folding. (pingcap#6774)
I agree with your analysis: constant folding should be disabled for the Thanks for looking into this! |
Added in #9252 |
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
The built-in benchmark function in MySQL is useful for testing. I was hoping to use it to generate load on TiDB so I could test auto-scaling in AWS easily (using CPU as a metric).
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: