slow SQL

By | 10月24日
Advertisement
mysql> select * from wanyouxi where youxitag='bird' ORDER BY credits desc limit 1;
+-------+------+--------+------------+---------+------------+------+-----+------+
| id    | uid  | gameid | youxitag| credits | dateline   | type | sid | wins |
+-------+------+--------+------------+---------+------------+------+-----+------+
| 49578 | 1155 |      0 | bird|   43830 | 1221623720 |    0 |   6 |    0 |
+-------+------+--------+------------+---------+------------+------+-----+------+
1 row in set (0.37 sec)
mysql> SELECT * from wanyouxi where youxijifen= (SELECT MAX(youxijifen) FROM cdb_playsgame where youxitag='bird') and youxitag='bird';
+-------+------+--------+------------+---------+------------+------+-----+------+
| id    | uid  | gameid | youxitag| credits | dateline   | type | sid | wins |
+-------+------+--------+------------+---------+------------+------+-----+------+
| 49578 | 1155 |      0 | bird|   43830 | 1221623720 |    0 |   6 |    0 |
+-------+------+--------+------------+---------+------------+------+-----+------+
1 row in set (0.30 sec)

Similar Posts:

  • Find out slow sql of mysql

    Recent days, I should do a sql tuning for a mysql database, and I know a bit of mysql db. In order to find the slow sql, i do the slow_query_log on to collect the slow sql. mysql> show variables like 'slow%'; +---------------------+------------------

  • 处理 mysql slow sql

    在slow_query_log 值为ON的情况下(默认为OFF 默认为10s,同时精确到微秒)默认(log_output值为FIFL时)就会把这种慢查询记录到:slow_query_log_file值所指定的文件中. mysql> select @@global.log_output; +---------------------+ | @@global.log_output | +---------------------+ | FILE | +---------------------+ 1

  • mysql slow sql

    cat /tmp/querytime.sort|awk '{print $2 " " $3}' |xargs -0 -I {} grep '{}' /duitang/logs/mysql/zcwdb/mysql_slow.log -A4 > /tmp/slow_sql_full.log

  • mysql top slow sql my.cnf配置

    log_slow_queries = /opt/djangostack-1.4-1/mysql/mysql-slow.loglong_query_time = 2log-queries-not-using-indexes

  • Using ROW_NUMBER() to paginate your data with SQL Server 2005 and ASP.NET

    Using ROW_NUMBER() to paginate your data with SQL Server 2005 and ASP.NET Jason Witty, 20 Nov 2005 4.67 (23 votes) Rate: vote 1vote 2vote 3vote 4vote 5 With the release of SQL Server 2005, Microsoft introduces the long overdue ROW_NUMBER() function.

  • 10 Common Mistakes Java Developers Make when Writing SQL

    The Performance Zone is supported by New Relic and AppDynamics. Both are leaders in the APM space with high-profile customers and massive cost reductions for those users. Java developers mix object-oriented thinking with imperative thinking, dependin

  • MySQL正确安全清空在线慢查询日志slow log

    1.see the slow log status; mysql> show variables like %slow%; +---------------------+------------------------------------------+ | Variable_name       | Value                                    | +---------------------+-------------------------------

  • 查询 where 优化

    [IT168 技术]触及数据库操作的基本都是变得很慢了,用的人都会觉得躁火~~然后把这个情况在群里一贴,包括机器配置什么的1说,马上JiuYouQunYou发话了,而且帮我确定了不是机器配置的问题,"深圳-枪手"热心人他的机器512内存过百W的数据里也跑患上飞快,甚至跟那些几W块的机器一样牛(吹过头了),呵呵~~~ 在群友的分析指点Xia,尝试把排序.条件等一个一个去除来做测试,结果发现问题就出在排序部分,去除排序的时候,执行时间由原来的48秒变成0.3x秒,这是个什么档次的BianH

  • how to optimize mysql for high traffic drupal site

    Configuring Mysql could be a daunting task if your Drupal site begins to scale and you start getting "too many connections" error or mysql server down errors. We had this opportunity to scale a Drupal site to 2 million page views a month and we

  • 查询语句优化,从48秒到0.3秒

    网站系统上线至今,数据量已经不知不觉上到500M,近8W记录了.涉及数据库操作的基本都是变得很慢了,用的人都会觉得躁火~~然后把这个情况在群里一贴,包括机器配置什么的一说,马上就有群友发话了,而且帮我确定了不是机器配置的问题,"深圳-枪手"热心人他的机器512内存过百W的数据里也跑得飞快,甚至跟那些几W块的机器一样牛(吹过头了),呵呵~~~ 在群友的分析指点下,尝试把排序.条件等一个一个去除来做测试,结果发现问题就出在排序部分,去除排序的时候,执行时间由原来的48秒变成0.3x秒,这是

Tags: