?????SQL?????????
???????????? ???????[ 2016/7/5 10:50:51 ] ????????????? SQL
??????????????????????
?????????ss_si_id ?????β?????????????????? ?????????????????????????Cardinality ???y???? PRIMARY ????????????????????? ?????????????????? ????????????????????????????????
????xiean@localhost:js_sku 03:27:47>analyze table js_sgoods_sku;
????+----------------------+---------+----------+----------+
????| Table | Op | Msg_type | Msg_text |
????+----------------------+---------+----------+----------+
????| js_sku.js_sgoods_sku | analyze | status | OK |
????+----------------------+---------+----------+----------+
????but ????????β? ??Щ??????????????
xiean@localhost:js_sku 03:28:14>show index from js_sgoods_sku;
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| js_sgoods_sku | 0 | PRIMARY | 1 | ss_id | A | 18621349 | NULL | NULL | | BTREE | | |
| js_sgoods_sku | 1 | ss_si_id | 1 | ss_si_id | A | 1551779 | NULL | NULL | | BTREE | | |
| js_sgoods_sku | 1 | ss_si_id | 2 | ss_av_zid | A | 6207116 | NULL | NULL | | BTREE | | |
| js_sgoods_sku | 1 | ss_si_id | 3 | ss_av_fid | A | 18621349 | NULL | NULL | | BTREE | | |
| js_sgoods_sku | 1 | IDX_001 | 1 | ss_sa_id | A | 3724269 | NULL | NULL | | BTREE | | |
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
?????????????? ss_si_id ?????????Cardinality?? ???????????????2????????????????????????????????????????????????????????????????????????????????????????????仯??
?????e??????????????????????? ??????????Ч????????????????????????
????+--------------++----------++------------------+
????| ss_si_id=0; || count(*) || 7994788/19048617 |
????+--------------++----------++------------------+
????| 7994788 || 19048617 || 0.4197 |
????+--------------++----------++------------------+
??????????????????????????????????????? ?????д????? ss_si_id??0 ???????????????????????? 41% ??????
?????e??????????????????????????????????????SQL?????1?????
????????????????ó????????????????Щ?????????? goods_service ???????????????????£?
????1. cpu ??????? ??
????2. jstatck pid ???dump ?????????????????dump ??F
????3. dump ?????????????????????????????????? ?????? BLOCKED ??
????4. ???jstat ??gcutil ???? FGC ???????10s????FGC???
????5. ?????ó????????????
??????????????????????????? ?????????????????700w?????????????goods_service ??汩??????????????????????????????
????OK???????????????????????????ν?????????????
???????????????????????? ss_si_id??0 ???μ????????????ε????SQL????????????ε???????ж????
????1. ???????????ж??????????? ??? ??? ?в?? ss_si_id??0 ?????????
????2. ??????SQL????????????SQL???
???????????DB???????????????? ??????????????DB??????????????? 0.xx ??????? 50+ ?????????????????????????????? ??????????????????DB????????????
??????????????????′??????
????1.???????з????SQL??? ?????????WHERE ???????????????????? AND ss_si_id <> 0 ????MySQL??м???????ε??SQL;
????2.DBA ????kill ???????????????DB??????????down????????????????????????? pt-kill ????????ò???????????????
???????????????????
????1.?????????? default ??? SQL ??????????????????????
????2.?????????????С???????????????????·???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???????????SQL???SQL??й????е????????????mysql?????????????SQL??????????????mysql????? distinct?÷?MySQL?н???????????з??Mysql????????????????sql server 2000??????????????MySQL Cluster??δ??????????????SQL Server???????????????????λ?????PHP??SQL????????????????????????????SQL??????????SQLд?????SQL Server????????????????????????????????????SQL?????Pythonд???NoSQL?????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????