doujing3896 2015-05-02 07:33
浏览 60
已采纳

Google Cloud SQL中slow_log表的低性能

I'm using a Google Cloud SQL instance for a project on Google App Engine. I have enabled the slow query log flag to store slow queries. But the slow_log table's performance is really bad, just for selecting some data took about 6 minutes.

I have also noted that the logged queries are not really "slow", i mean they have 0 as query time and lock time. See example:

mysql> SELECT * FROM slow_log LIMIT 900000,1; start_time: 2015-05-01 20:06:16 query_time: 00:00:00 lock_time: 00:00:00 rows_sent: 1 rows_examined: 1 sql_text: select * fromserviceswherename= 'facebook' limit 1 1 row in set (6 min 23.37 sec)

Should I add some indexes to the table? or should I truncate it to decrease the number of rows?

  • 写回答

2条回答 默认 最新

  • dtjo51649 2015-05-13 19:41
    关注

    I have found the problem, the flag long_query_time was set to 0, so every log was stored.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探