-
Notifications
You must be signed in to change notification settings - Fork 98
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
tpch: add query tuning configs for tpch #179
Conversation
|
I didn't realize that there exists such a flag. And yes, we should definitely do so. Thanks for pointing this out. I will update soon.
Is there an existing handy utility that I can use to differentiate tidb from other mysql-compatible databases? EDIT: And also I found there are already tidb-specific variables being used in, e.g.: Lines 175 to 180 in 50e155e
Possibly meaning that current "mysql" can only be tidb? |
func executeTpch(action string) { | ||
if action == "run" && driver == "mysql" && tpchConfig.EnableQueryTuning { |
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.
This has to come prior to openDB()
call because it leverages connection parameters which only take effect when connecting to the database.
I've updated the PR by leveraging existing connection parameters rather than explicitly setting session variables via SQL. About your second concern, the best I can do so far is to check for "mysql" only because there is no existing way to differentiate tidb from other possible mysql vendors, which is also affecting other tidb-specific logic. @Yui-Song Could you please take a look? Thanks. |
Set some session variables known to be effective for tpch before each tpch query to tune performance. And also add flags to turn it on/off and override the default variables.
tidb_default_string_match_selectivity=0.1
: For optimal join order, esp. q9.tidb_opt_join_reorder_threshold=60
: For general optimal join order.tidb_prefer_broadcast_join_by_exchange_data_size=ON
: For better join type between broadcast join and partition join.