MariaDB社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2326|回复: 1
打印 上一主题 下一主题

mysql 请问如何优化?

[复制链接]
跳转到指定楼层
1#
发表于 2013-4-8 16:22:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 .[Vani 于 2013-4-8 17:06 编辑

SELECT COUNT(DISTINCT c.uc_id),b.industry_level_3  FROM sys_account_industry a
LEFT JOIN sys_account f ON f.account_id = a.account_id
LEFT JOIN sys_user_product_region g ON g.user_id = f.user_id
LEFT JOIN dim_product b ON g.product_id = b.product_id
LEFT JOIN fact_information c ON c.product_id = b.product_id
LEFT JOIN fact_bridge_info_risk d ON d.uc_id = c.uc_id
LEFT JOIN dim_risk e ON e.risk_id = d.risk_id
/*WHERE a.account_id = ?  AND a.type = ? "+condition+*/
GROUP BY b.industry_level_3

  1.     id  select_type  table   type    possible_keys        key                  key_len  ref                        rows  Extra                                       
  2. ------  -----------  ------  ------  -------------------  -------------------  -------  -----------------------  ------  --------------------------------------------
  3.      1  SIMPLE       a       ref     PRIMARY              PRIMARY              4        const                         2  Using index; Using temporary; Using filesort
  4.      1  SIMPLE       f       const   PRIMARY,account_id   PRIMARY              4        const                         1                                             
  5.      1  SIMPLE       g       ref     PRIMARY              PRIMARY              4        244_shendu.f.user_id          7  Using index                                 
  6.      1  SIMPLE       b       eq_ref  PRIMARY              PRIMARY              4        244_shendu.g.product_id       1                                             
  7.      1  SIMPLE       c       ref     idx_fact_product_id  idx_fact_product_id  4        244_shendu.b.product_id     297  Using index                                 
  8.      1  SIMPLE       d       ref     PRIMARY              PRIMARY              4        244_shendu.c.uc_id            1  Using index                                 
  9.      1  SIMPLE       e       eq_ref  PRIMARY              PRIMARY              4        244_shendu.d.risk_id          1  Using index                                 
复制代码
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 顶 踩
2#
发表于 2016-1-25 15:58:30 | 只看该作者
癫痫的急救措施是什么 http://jiankang.zkxww.com/dxbdyf/10970319082.html
癫痫的护理要有针对性 http://jiankang.zkxww.com/dxbdyf/10970319422.html
癫痫的症状及表现 http://jiankang.zkxww.com/dxbdyf/10970319516.html
了解小儿癫痫早期症状很重要 http://jkbk.thmz.com/etdxb/10970283794.html
癫痫病专家告诉您为何会患癫痫病 http://jkbk.thmz.com/dxbby/10970283964.html
儿童癫痫患者饮食禁忌有哪些? http://jkbk.thmz.com/ddbc/10970284039.html
了解常见的儿童癫痫病发作症状,家长不可忽视 http://jkbk.thmz.com/etdxb/10970284130.html
癫痫病人可以服用补药吗 http://jkbk.thmz.com/zysm/10970284205.html
癫痫病为何常常发作,专家为您讲解! http://jkbk.thmz.com/dxbby/10970284344.html
儿童癫痫病人的饮食禁忌介绍 http://jkbk.thmz.com/ddbc/10970284576.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|MariaDB社区 ( 京ICP备07012489号    |
业务联系: QQ:48474881; 邮箱: 48474881@qq.com; 电话:13911732319
声明:本站部分文章是网友转载,若未经作者同意或署名有误,请联系网站管理员。

GMT+8, 2024-9-19 10:07 , Processed in 0.110062 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表