AWS RDS Param long_query_time设置为0但仍然没有slow_logs

时间:2014-07-15 02:12:00

标签: mysql amazon-rds

我已使用以下参数配置AWS RDS:

join_buffer_size: 67108864
log_queries_not_using_indexes: 1
long_query_time: 0
query_cache_size: 67108864
query_cache_type: 1
slow_query_log: 1

Mysqltuner提供以下输出:

[!!] Slow queries: 98% (764K/772K)
[OK] Highest usage of available connections: 1% (51/5082)
[OK] Key buffer size / total MyISAM indexes: 16.0M/420.5M
[OK] Key buffer hit rate: 98.1% (41M cached / 789K reads)
[OK] Query cache efficiency: 70.2% (381K cached / 543K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (50 temp sorts / 85K sorts)
[!!] Joins performed without indexes: 3023
[OK] Temporary tables created on disk: 2% (1K on disk / 67K total)
[OK] Thread cache hit rate: 99% (51 created / 47K connections)
[OK] Table cache hit rate: 25% (1K open / 6K opened)
[OK] Open file limit used: 1% (1K/65K)
[OK] Table locks acquired immediately: 98% (985K immediate / 998K locks)

我的查询日志很慢。我想我应该为每个查询得到一个。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

  • 登录您的AWS控制台并转到RDS。
  • 从左侧菜单中选择参数组
  • 通过复制默认的Postgres参数组
  • 为Postgres创建一个新参数组
  • 在新组中编辑以下参数:
  • 参数名称值
  • log_min_duration_statement 250
  • log_statement none
  • log_duration 0