阿里云sls收集mysql慢日志

本文介绍了如何配置阿里云SLS服务,以便有效地收集和分析MySQL的慢查询日志。通过设置合适的正则匹配规则,可以精准地抓取到日志中的关键信息,帮助优化数据库性能。
摘要由CSDN通过智能技术生成

日志格式

# Time: 210303 12:28:49
# User@Host: up366mall[up366mall] @  [192.168.23.9]  Id: 173673774
# Query_time: 3.548998  Lock_time: 0.000083 Rows_sent: 1  Rows_examined: 2297436
SET timestamp=1614745729;
select COUNT(DISTINCT(a.`order_id`))
    from txm_order a

    where a.goods_amount>0 and a.pay_status = 2 and NOT EXISTS (SELECT 1 FROM txm_organ_exclusion o WHERE a.organ_id=o.organ_id)









      and a.sale_confirm_status = 1;
# Time: 210303 13:22:17
# User@Host: up366mall[up366mall] @  [192.168.23.9]  Id: 173674054
# Query_time: 1.134606  Lock_time: 0.000415 Rows_sent: 1  Rows_examined: 2311088
SET timestamp=1614748937;
SELECT
    IFNULL(SUM(c.goods_amount+ c.discount),0) AS moneyAmount,
    IFNULL(SUM(c.bonus),0) AS bonus,
    IFNULL(SUM(c.discount),0) AS discount,
    IFNULL(SUM(c.integral_money),0) AS integreal,
    IFNULL(SUM(c.coupon_money),0) AS coupon,
    IFNULL(SUM(c.money_p
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值