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

ProxySQL 2.0.6 fails to set session variable OPTIMIZER_SWITCH #2200

Open
Trofym opened this issue Aug 16, 2019 · 2 comments
Open

ProxySQL 2.0.6 fails to set session variable OPTIMIZER_SWITCH #2200

Trofym opened this issue Aug 16, 2019 · 2 comments

Comments

@Trofym
Copy link

Trofym commented Aug 16, 2019

ProxySQL 2.0.6 fails to change switchable optimizations via session variable OPTIMIZER_SWITCH, but in ProxySQL 2.0.5 it works as expected.
Please return to old behaviour.
OS = CentOS 7.5

proxy > select version();
+-------------------+
| version()         |
+-------------------+
| 2.0.6-73-gc746bf7 |
+-------------------+


proxy > select @@OPTIMIZER_SWITCH\G
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)

proxy > SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=off";
Query OK, 0 rows affected (0.00 sec)

proxy > select @@OPTIMIZER_SWITCH\G
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)

proxy > SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=default";
Query OK, 0 rows affected (0.00 sec)

proxy > select @@OPTIMIZER_SWITCH\G
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)

Record from error log:

2019-08-16 17:54:16 MySQL_Session.cpp:5094:handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(): [WARNING] Unable to parse unknown SET query. Setting lock_hostgroup. Please report a bug for future enhancements:SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=off"
2019-08-16 17:54:32 MySQL_Session.cpp:5102:handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(): [WARNING] Unable to parse unknown SET query. Not setting lock_hostgroup because already set. Please report a bug for future enhancements: SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=default"

Same test on ProxySQL 2.0.5:

proxy > select version();
+-------------------+
| version()         |
+-------------------+
| 2.0.5-37-gc8e32ee |
+-------------------+

proxy > select @@OPTIMIZER_SWITCH\G
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=o
n,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,con
dition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)

proxy >  SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=off";                                                                                                                       
Query OK, 0 rows affected (0.00 sec)

proxy > select @@OPTIMIZER_SWITCH\G                                                                                                                                                           
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=
on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,co
ndition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)

proxy >  SET SESSION OPTIMIZER_SWITCH = "index_merge_intersection=default";                                                                                                                   
Query OK, 0 rows affected (0.00 sec)

proxy > select @@OPTIMIZER_SWITCH\G                                                                                                                                                           
*************************** 1. row ***************************
@@OPTIMIZER_SWITCH: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=o
n,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,con
dition_fanout_filter=on,derived_merge=on
1 row in set (0.00 sec)
@Trofym Trofym changed the title ProxySQL 2.0.6 failing to set session variable OPTIMIZER_SWITCH ProxySQL 2.0.6 fails to set session variable OPTIMIZER_SWITCH Aug 16, 2019
@renecannao
Copy link
Contributor

@Trofym : it doesn't look like it fails, but it succeeds.
The error log is noisy, but it is saying it is disabling multiplexing because it doesn't recognize the SET command.
In this case, 2.0.6 behaves correctly, while 2.0.5 doesn't (it keeps multiplexing enabled)

@Trofym
Copy link
Author

Trofym commented Aug 19, 2019

@renecannao I agree, 2.0.6 behaves correctly, but we use this kind of queries very frequently and error log became big and messy. Can you add such query to exeption and not display as warning in error log?

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

No branches or pull requests

2 participants