[mysqldumpslow 报错] Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236.

来源:互联网 发布:蚂蜂窝连app接不到网络 编辑:程序博客网 时间:2024/06/06 01:39
mysqldumpslow报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236.

总结:是因为top数目太多了,mysqldumpslow遍历不过来的缘故。

/usr/local/mysql/bin/mysqldumpslow -s -t 15 /root/db01-102-slow.log 


1,把r去掉试试,还是报错,参数不识别。

  1. [root@slave ]# /usr/local/mysql/bin/mysqldumpslow -s -t 15 /root/db01-102-slow.log   
  2.   
  3. Reading mysql slow query log from 15 /root/db01-102-slow.log  
  4. Can't open 15: 没有那个文件或目录 at /usr/local/mysql/bin/mysqldumpslow line 91.  
  5. Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts  
  6.   select count(*)  
  7.   from coupon_lot  
  8.   left join coupon   
  9.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  10.   LEFT JOIN brand  
  11.   ON brand.brand_id=coupon_lot.brand_id  
  12.   LEFT JOIN product_category  
  13.   on product_category.category_id=coupon_lot.category_id  
  14.   
  15. Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [dubbo]@2hosts  
  16.   select count(*) from user_info  
  17.   LEFT JOIN system_region a  
  18.   ON province_id =a.region_id  
  19.   LEFT JOIN system_region b  
  20.   ON city_id = b.region_id  
  21.   LEFT JOIN system_region c  
  22.   ON district_id = c.region_id  
  23.   
  24. Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts  
  25.   select   
  26.   coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,  
  27.   coupon.code,  coupon_lot.coupon_type, coupon.state,  
  28.   coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel,   
  29.   coupon_lot.is_reusable, coupon_lot.start_datetime,  
  30.   coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,  
  31.   coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,  
  32.   coupon_lot.pdt_code,brand.brand_name,product_category.category_name  
  33.   from coupon_lot  
  34.   left join coupon   
  35.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  36.   LEFT JOIN brand  
  37.   ON brand.brand_id=coupon_lot.brand_id  
  38.   LEFT JOIN product_category  
  39.   on product_category.category_id=coupon_lot.category_id  
  40.   group by coupon_lot.coupon_lot_id  
  41.   order by coupon_lot.create_datetime DESC  
  42.   limit N,N  
  43.   
  44. Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts  
  45.   select   
  46.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  47.   add_time , return_type,   
  48.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  49.   return_total_fee, total_paid,   
  50.   return_desc, return_order_status,  return_pay_status ,  
  51.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  52.   from order_return  LEFT JOIN   order_info oi  
  53.   on order_return.relating_order_sn = oi.order_sn   
  54.   left join user_info ui on oi.user_id = ui.user_id  
  55.   left join order_payment on order_payment.order_sn = oi.order_sn  
  56.   order by order_return.add_time DESC  
  57.   limit N,N  
  58.   
  59. Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost  
  60.   select sleep(N)  
  61.   
  62. Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[xx]  
  63.   select   
  64.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  65.   add_time , return_type,   
  66.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  67.   return_total_fee, total_paid,   
  68.   return_desc, return_order_status,  return_pay_status ,  
  69.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  70.   from order_return  LEFT JOIN   order_info oi  
  71.   on order_return.relating_order_sn = oi.order_sn   
  72.   left join user_info ui on oi.user_id = ui.user_id  
  73.   left join order_payment on order_payment.order_sn = oi.order_sn  
  74.   order by order_return.add_time DESC  
  75.   , oi.order_sn   
  76.   limit N,N  
  77.   
  78. Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts  
  79.   select  
  80.   user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone,   
  81.   birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime,   
  82.   active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel,   
  83.   tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key,   
  84.   verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question,   
  85.   verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel  
  86.   from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')  

2,查看下mysqldumpslow 使用参数,-s后面需要带参数的,看了西夏at比较合适

  1. [root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow  --help  
  2. Usage: mysqldumpslow [ OPTS... ] [ LOGS... ]  
  3.   
  4. Parse and summarize the MySQL slow query log. Options are  
  5.   
  6.   --verbose    verbose  
  7.   --debug      debug  
  8.   --help       write this text to standard output  
  9.   
  10.   -v           verbose  
  11.   -d           debug  
  12.   -s ORDER     what to sort by (al, at, ar, c, l, r, t), 'at' is default  
  13.                 al: average lock time  
  14.                 ar: average rows sent  
  15.                 at: average query time  
  16.                  c: count  
  17.                  l: lock time  
  18.                  r: rows sent  
  19.                  t: query time    
  20.   -r           reverse the sort order (largest last instead of first)  
  21.   -t NUM       just show the top n queries  
  22.   -a           don't abstract all numbers to N and strings to 'S'  
  23.   -n NUM       abstract numbers with at least n digits within names  
  24.   -g PATTERN   grep: only consider stmts that include this string  
  25.   -h HOSTNAME  hostname of db server for *-slow.log filename (can be wildcard),  
  26.                default is '*', i.e. match all  
  27.   -i NAME      name of server instance (if using mysql.server startup script)  
  28.   -l           don't subtract lock time from total time  


3,在mysqldumpslow的-s后面加入 at参数试试:  [root@slave ]# /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log 

  1. [root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log   
  2. Reading mysql slow query log from /root/db01-102-slow.log  
  3. Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts  
  4.   select   
  5.   coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,  
  6.   coupon.code,  coupon_lot.coupon_type, coupon.state,  
  7.   coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel,   
  8.   coupon_lot.is_reusable, coupon_lot.start_datetime,  
  9.   coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,  
  10.   coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,  
  11.   coupon_lot.pdt_code,brand.brand_name,product_category.category_name  
  12.   from coupon_lot  
  13.   left join coupon   
  14.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  15.   LEFT JOIN brand  
  16.   ON brand.brand_id=coupon_lot.brand_id  
  17.   LEFT JOIN product_category  
  18.   on product_category.category_id=coupon_lot.category_id  
  19.   group by coupon_lot.coupon_lot_id  
  20.   order by coupon_lot.create_datetime DESC  
  21.   limit N,N  
  22.   
  23. Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts  
  24.   select count(*)  
  25.   from coupon_lot  
  26.   left join coupon   
  27.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  28.   LEFT JOIN brand  
  29.   ON brand.brand_id=coupon_lot.brand_id  
  30.   LEFT JOIN product_category  
  31.   on product_category.category_id=coupon_lot.category_id  
  32.   
  33. Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts  
  34.   select  
  35.   user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone,   
  36.   birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime,   
  37.   active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel,   
  38.   tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key,   
  39.   verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question,   
  40.   verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel  
  41.   from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')  
  42.   
  43. Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [dubbo]@2hosts  
  44.   select count(*) from user_info  
  45.   LEFT JOIN system_region a  
  46.   ON province_id =a.region_id  
  47.   LEFT JOIN system_region b  
  48.   ON city_id = b.region_id  
  49.   LEFT JOIN system_region c  
  50.   ON district_id = c.region_id  
  51.   
  52. Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[10.10.3.8]  
  53.   select   
  54.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  55.   add_time , return_type,   
  56.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  57.   return_total_fee, total_paid,   
  58.   return_desc, return_order_status,  return_pay_status ,  
  59.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  60.   from order_return  LEFT JOIN   order_info oi  
  61.   on order_return.relating_order_sn = oi.order_sn   
  62.   left join user_info ui on oi.user_id = ui.user_id  
  63.   left join order_payment on order_payment.order_sn = oi.order_sn  
  64.   order by order_return.add_time DESC  
  65.   , oi.order_sn   
  66.   limit N,N  
  67.   
  68. Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts  
  69.   select   
  70.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  71.   add_time , return_type,   
  72.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  73.   return_total_fee, total_paid,   
  74.   return_desc, return_order_status,  return_pay_status ,  
  75.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  76.   from order_return  LEFT JOIN   order_info oi  
  77.   on order_return.relating_order_sn = oi.order_sn   
  78.   left join user_info ui on oi.user_id = ui.user_id  
  79.   left join order_payment on order_payment.order_sn = oi.order_sn  
  80.   order by order_return.add_time DESC  
  81.   limit N,N  
  82.   
  83. Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost  
  84.   select sleep(N)  
  85.   
  86. Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236.  
看到后面还是报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236.

4,去看看/usr/local/mysql/bin/mysqldumpslow的第161行左右,到底是在操作什么脚本。

  1. 156 my @sorted = sort { $stmt{$b}->{$opt{s}} <=> $stmt{$a}->{$opt{s}} } keys %stmt;  
  2. 157 @sorted = @sorted[0 .. $opt{t}-1] if $opt{t};  
  3. 158 @sorted = reverse @sorted         if $opt{r};  
  4. 159   
  5. 160 foreach (@sorted) {  
  6. 161     my $v = $stmt{$_} || die;  
  7. 162     my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)};  
  8. 163     my @users = keys %{$v->{users}};  
  9. 164     my $user  = (@users==1) ? $users[0] : sprintf "%dusers",scalar @users;  
  10. 165     my @hosts = keys %{$v->{hosts}};  
  11. 166     my $host  = (@hosts==1) ? $hosts[0] : sprintf "%dhosts",scalar @hosts;  
  12. 167     printf "Count: %d  Time=%.2fs (%ds)  Lock=%.2fs (%ds)  Rows=%.1f (%d), $user\@$host\n%s\n\n",  
  13. 168             $c, $at,$t, $al,$l, $ar,$r, $_;  
  14. 169 }  
  15. 170   
  16. 171 sub usage {  
  17. 172     my $str= shift;  
看到主要是foreach (@sorted)遍历函数,也就是遍历到chunk 236的时候就died结束了,没有办法往下继续foreach了。因为以前写过代码,知道报错所在的这一行

  1. my $v = $stmt{$_} || die;  
是遍历第一句,那么肯定是赋值语句,报错Died,chunk 236肯定是已经遍历到末尾没有数据了,看这个函数没有判断传入的参数是否为null的逻辑,所以当文件数据已经遍历完,但是命令还没有结束,所以继续遍历,遍历null的时候报错,所以进程中止了,解决办法就是做个限制不要遍历超过原始数据的字符串长度。那么我们再来看执行的命令:

 /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log 有 -t 15这一句,那么就是要显示出前15个记录,那么如果我的slow.log统计出来只有12个不到15个,而这里有继续遍历到15的话,那进程肯定会Died。


所以这里有2个解决方案:

1 修改/usr/local/mysql/bin/mysqldumpslow里面的源代码,加null判断。

这个过程有些复杂,暂时略过吧,期待后续空了再研究。


2 修改命令  /usr/local/mysql/bin/mysqldumpslow -s at -t 15 /root/db01-102-slow.log ,把-t 15修改成-t 10或者-t 5试试。

试了好几次,发现临界点在-t 7上面,如下:

  1. [root@slave~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 8 /root/db01-102-slow.log   
  2. Reading mysql slow query log from /root/db01-102-slow.log  
  3. Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [dubbo]@2hosts  
  4.   select   
  5.   coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,  
  6.   coupon.code,  coupon_lot.coupon_type, coupon.state,  
  7.   coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel,   
  8.   coupon_lot.is_reusable, coupon_lot.start_datetime,  
  9.   coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,  
  10.   coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,  
  11.   coupon_lot.pdt_code,brand.brand_name,product_category.category_name  
  12.   from coupon_lot  
  13.   left join coupon   
  14.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  15.   LEFT JOIN brand  
  16.   ON brand.brand_id=coupon_lot.brand_id  
  17.   LEFT JOIN product_category  
  18.   on product_category.category_id=coupon_lot.category_id  
  19.   group by coupon_lot.coupon_lot_id  
  20.   order by coupon_lot.create_datetime DESC  
  21.   limit N,N  
  22.   
  23. Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts  
  24.   select count(*)  
  25.   from coupon_lot  
  26.   left join coupon   
  27.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  28.   LEFT JOIN brand  
  29.   ON brand.brand_id=coupon_lot.brand_id  
  30.   LEFT JOIN product_category  
  31.   on product_category.category_id=coupon_lot.category_id  
  32.   
  33. Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [dubbo]@2hosts  
  34.   select  
  35.   user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone,   
  36.   birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime,   
  37.   active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel,   
  38.   tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key,   
  39.   verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question,   
  40.   verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel  
  41.   from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')  
  42.   
  43. Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [xx]@2hosts  
  44.   select count(*) from user_info  
  45.   LEFT JOIN system_region a  
  46.   ON province_id =a.region_id  
  47.   LEFT JOIN system_region b  
  48.   ON city_id = b.region_id  
  49.   LEFT JOIN system_region c  
  50.   ON district_id = c.region_id  
  51.   
  52. Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [xx]@[xxx]  
  53.   select   
  54.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  55.   add_time , return_type,   
  56.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  57.   return_total_fee, total_paid,   
  58.   return_desc, return_order_status,  return_pay_status ,  
  59.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  60.   from order_return  LEFT JOIN   order_info oi  
  61.   on order_return.relating_order_sn = oi.order_sn   
  62.   left join user_info ui on oi.user_id = ui.user_id  
  63.   left join order_payment on order_payment.order_sn = oi.order_sn  
  64.   order by order_return.add_time DESC  
  65.   , oi.order_sn   
  66.   limit N,N  
  67.   
  68. Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [xx]@2hosts  
  69.   select   
  70.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  71.   add_time , return_type,   
  72.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  73.   return_total_fee, total_paid,   
  74.   return_desc, return_order_status,  return_pay_status ,  
  75.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  76.   from order_return  LEFT JOIN   order_info oi  
  77.   on order_return.relating_order_sn = oi.order_sn   
  78.   left join user_info ui on oi.user_id = ui.user_id  
  79.   left join order_payment on order_payment.order_sn = oi.order_sn  
  80.   order by order_return.add_time DESC  
  81.   limit N,N  
  82.   
  83. Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost  
  84.   select sleep(N)  
  85.   
  86. Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236.  
  87.   
  88. -- 临界点 -t 7  
  89. [root@db-master-2 ~]# /usr/local/mysql/bin/mysqldumpslow -s at -t 7 /root/db01-102-slow.log   
  90.   
  91. Reading mysql slow query log from /root/db01-102-slow.log  
  92. Count: 22  Time=13.20s (290s)  Lock=0.00s (0s)  Rows=10.0 (220), [xx]@2hosts  
  93.   select   
  94.   coupon_id, coupon_lot.coupon_lot_id, coupon_lot.remark,  
  95.   coupon.code,  coupon_lot.coupon_type, coupon.state,  
  96.   coupon_lot.ckey, coupon_lot.cvalue, coupon_lot.discount, coupon_lot.type, coupon_lot.channel,   
  97.   coupon_lot.is_reusable, coupon_lot.start_datetime,  
  98.   coupon_lot.end_datetime, coupon_lot.create_datetime, coupon.update_datetime ,coupon_lot.department,  
  99.   coupon_lot.state as couponLotState, coupon_lot.create_operator,coupon_lot.coupon_category,  
  100.   coupon_lot.pdt_code,brand.brand_name,product_category.category_name  
  101.   from coupon_lot  
  102.   left join coupon   
  103.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  104.   LEFT JOIN brand  
  105.   ON brand.brand_id=coupon_lot.brand_id  
  106.   LEFT JOIN product_category  
  107.   on product_category.category_id=coupon_lot.category_id  
  108.   group by coupon_lot.coupon_lot_id  
  109.   order by coupon_lot.create_datetime DESC  
  110.   limit N,N  
  111.   
  112. Count: 22  Time=9.61s (211s)  Lock=0.00s (0s)  Rows=1.0 (22), [dubbo]@2hosts  
  113.   select count(*)  
  114.   from coupon_lot  
  115.   left join coupon   
  116.   on coupon.coupon_lot_id = coupon_lot.coupon_lot_id  
  117.   LEFT JOIN brand  
  118.   ON brand.brand_id=coupon_lot.brand_id  
  119.   LEFT JOIN product_category  
  120.   on product_category.category_id=coupon_lot.category_id  
  121.   
  122. Count: 5  Time=2.47s (12s)  Lock=0.00s (0s)  Rows=0.0 (0), [xx]@2hosts  
  123.   select  
  124.   user_id, usename, nickname, password, user_group_id, realname, gender, email, mobilephone,   
  125.   birthday, province_id, city_id, district_id, marry, income, remarks, create_datetime,   
  126.   active_state, verityEmail, verityPhone, credit, last_login, last_ip, is_locked, channel,   
  127.   tag, union_partner_uuid, union_user_safekey, is_black, qq, weibo_id, verity_email_key,   
  128.   verity_phone_key, verity_email_datetime, verity_phone_datetime, verity_question,   
  129.   verity_answer, cps_code, cps_time_from, cps_time_to, cps_cookie, first_channel  
  130.   from user_info where mobilephone = 'S' and (channel is null or trim(channel) ='S')  
  131.   
  132. Count: 177  Time=1.40s (247s)  Lock=0.00s (0s)  Rows=1.0 (177), [xx]@2hosts  
  133.   select count(*) from user_info  
  134.   LEFT JOIN system_region a  
  135.   ON province_id =a.region_id  
  136.   LEFT JOIN system_region b  
  137.   ON city_id = b.region_id  
  138.   LEFT JOIN system_region c  
  139.   ON district_id = c.region_id  
  140.   
  141. Count: 1  Time=1.13s (1s)  Lock=0.00s (0s)  Rows=10.0 (10), [dubbo]@[xxx]  
  142.   select   
  143.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  144.   add_time , return_type,   
  145.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  146.   return_total_fee, total_paid,   
  147.   return_desc, return_order_status,  return_pay_status ,  
  148.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  149.   from order_return  LEFT JOIN   order_info oi  
  150.   on order_return.relating_order_sn = oi.order_sn   
  151.   left join user_info ui on oi.user_id = ui.user_id  
  152.   left join order_payment on order_payment.order_sn = oi.order_sn  
  153.   order by order_return.add_time DESC  
  154.   , oi.order_sn   
  155.   limit N,N  
  156.   
  157. Count: 8  Time=1.09s (8s)  Lock=0.00s (0s)  Rows=10.0 (80), [dubbo]@2hosts  
  158.   select   
  159.   return_sn,  relating_order_sn, return_from,  oi.order_out_sn ,  
  160.   add_time , return_type,   
  161.   return_pay, ui.usename as userName, return_consignee, return_goods_count ,  
  162.   return_total_fee, total_paid,   
  163.   return_desc, return_order_status,  return_pay_status ,  
  164.   return_shipping_status, order_return.lock_operator, order_return.return_invoice_no  
  165.   from order_return  LEFT JOIN   order_info oi  
  166.   on order_return.relating_order_sn = oi.order_sn   
  167.   left join user_info ui on oi.user_id = ui.user_id  
  168.   left join order_payment on order_payment.order_sn = oi.order_sn  
  169.   order by order_return.add_time DESC  
  170.   limit N,N  
  171.   
  172. Count: 1  Time=1.00s (1s)  Lock=0.00s (0s)  Rows=1.0 (1), root[root]@localhost  
  173.   select sleep(N)  
  174.   
  175. [root@db-master-2 ~]#   

最终总结:
mysqldumpslow报错:
Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236. 是因为top数目太多了,mysqldumpslow遍历不过来的缘故。

0 0
原创粉丝点击