MySQL????????????????
???????????? ???????[ 2015/8/11 11:02:30 ] ????????????? ???????????
????rows???????????????????????????????????????????????????order by + limit???????????????????????????????SQL?????????order by ?? limit?????????????????????????
????select
????count(*)
????from
????contact c
????inner join
????contact_branch cb
????on c.id = cb.contact_id
????inner join
????branch_user bu
????on cb.branch_id = bu.branch_id
????and bu.status in (
????1??
????2)
????inner join
????org_emp_info oei
????on oei.data_id = bu.user_id
????and oei.node_left >= 2875
????and oei.node_right <= 10802
????and oei.org_category = - 1
????+----------+
????| count(*) |
????+----------+
????| 778878 |
????+----------+
????1 row in set (5.19 sec)
???????????????????????778878?????????????70??????????????????????????????????????????????????·???????contact??created_time????????join??????????
???????????????????????????straight_join?????
????select
????c.id??
????c.name??
????c.position??
????c.sex??
????c.phone??
????c.office_phone??
????c.feature_info??
????c.birthday??
????c.creator_id??
????c.is_keyperson??
????c.giveup_reason??
????c.status??
????c.data_source??
????from_unixtime(c.created_time) as created_time??
????from_unixtime(c.last_modified) as last_modified??
????c.last_modified_user_id
????from
????contact c
????where
????exists (
????select
????1
????from
????contact_branch cb
????inner join
????branch_user bu
????on cb.branch_id = bu.branch_id
????and bu.status in (
????1??
????2)
????inner join
????org_emp_info oei
????on oei.data_id = bu.user_id
????and oei.node_left >= 2875
????and oei.node_right <= 10802
????and oei.org_category = - 1
????where
????c.id = cb.contact_id
????)
????order by
????c.created_time desc limit 0 ??
????10;
??????????Ч?? ?????1ms?????????13000????
????10 rows in set (0.00 sec)
?????????????????????????????????????????????????????join????join?????????????????????????????????????????????limit????????й??????mysql??????????????10?????????????join??????????????10???????????10???????join????????????join??????????????????????????????????????????????????????mysql?????????????10???????????????????????
?????ò????????SQL??????
????select
????sql_no_cache c.id??
????c.name??
????c.position??
????c.sex??
????c.phone??
????c.office_phone??
????c.feature_info??
????c.birthday??
????c.creator_id??
????c.is_keyperson??
????c.giveup_reason??
????c.status??
????c.data_source??
????from_unixtime(c.created_time) as created_time??
????from_unixtime(c.last_modified) as last_modified??
????c.last_modified_user_id
????from
????contact c
????where
????exists (
????select
????1
????from
????contact_branch cb
????inner join
????branch_user bu
????on cb.branch_id = bu.branch_id
????and bu.status in (
????1??
????2)
????inner join
????org_emp_info oei
????on oei.data_id = bu.user_id
????and oei.node_left >= 2875
????and oei.node_right <= 2875
????and oei.org_category = - 1
????where
????c.id = cb.contact_id
????)
????order by
????c.created_time desc limit 0 ??
????10;
????Empty set (2 min 18.99 sec)
????2 min 18.99 sec??????????????????????mysql??nested loop?????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????SQL????????????Щ?????????????????????????????????????????????????????????SQL?????????????????????????????case??????????????????????????
?????????????????????????????????Щ?????????????????????????????????????1000?У??漰??16????join??“????SQL”????????????????????????????????????????????????????varchar?????????д???????????????????????????????????????????????????Щ???????????????????????????????????????????????????Щ??????????????
????д???????
????????????????????????????MySQL???????????????????Щ??????;?????????????????????????????????????????????????????????????κ?????????????????????????????????????MySQL?????????????Google/FaceBook/Taobao????????????????????????????????y???????е????“??????????????????д???????”
?????ο?
?????ο????????£?
????1.????????MySQL??
????2.?????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???mysql?????????????mysql????? distinct?÷?MySQL?н???????????з??Mysql?????????MySQL Cluster??δ????????????????ν?MySQL??????????300???????MySQL???Uber???????????????????MySql SQL??????????MySQL?????????????????λЧ?????SQL???Java???????:?????MySQL???????linux?°??mysql????MySQL ???????????????????binlog??MySQL????????????Щ??????MySQL???????Mysql???????JDBC?????mysql?????
???·???
??????????????????
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 ??????