问题
I have a problem in my Google Cloud SQL database. State of some queries stays "statistics" for long time.
+-------+------+-----------+------+---------+------+------------+--------------
| Id | User | Host | db | Command | Time | State | Info
+-------+------+-----------+------+---------+------+------------+--------------
| 18533 | root | localhost | mydb | Execute | 2485 | statistics | SELECT * FROM...
| 18537 | root | localhost | mydb | Execute | 2424 | statistics | SELECT * FROM...
| 18539 | root | localhost | mydb | Execute | 2363 | statistics | SELECT * FROM...
| 18542 | root | localhost | mydb | Execute | 2304 | statistics | SELECT * FROM...
I read this page. And I want to change "optimizer_search_depth" setting, but I can't find this setting in Google developer console -> Cloud SQL.
Can Google Cloud SQL change this setting? If it can't, is there another way to avoid long statistics issue?
回答1:
We heard you :) I've sent out a change that will add optimizer_search_depth as a configurable flag for Cloud SQL for MySQL 5.5 and 5.6. It needs to go through some rounds of review, but should be available sometime early next week.
I hope this helps you with your long queries!
Chris, Cloud SQL team
来源:https://stackoverflow.com/questions/28875929/optimizer-search-depth-in-google-cloud-sql