IT??????????????

MariaDB SQL????????Unix?????????????

?????whl??????????????????????????2018-11-16 08:51:00

???????С?????????????????????MariaDB(MySQL)?????????в??????????????????????????????????????С??????????????????????????????????MariaDB SQL???????????,????????Unix ?????????У??????????????????????????30??????????????

??????????????????????? GHTorrent ?????????????????????????????????? simple-rolap ??????????????

 simple-rolap

??????????????ζ???????????????MariaDB ??????? project_commits ???????????? commits ????????????????????????????? EXPLAIN ?????????????

EXZ???QTEFJTiC1xMrks/Y=" src="http://www.it165.net/uploadfile/2018/1115/20181115060938442.png" style="height: 124px; width: 368px" />

?????????????е???????project_commits ?? 50 ???м????commits ?? 8.47 ???м?????????????????С????? 16GB???????????????????????????????????????????????????????????????? pmonitor ????????????????????????????????а??????????? 373 ??С???????????

?????????????????????????????????????(sort-merge join)????? I/O ????????????????????????????????????? dba.stackexchange.com ????????????????????Щ??????????????????????????????????????????????????????飬?????????????????????鹣???????????????????????????????????????????Ч??????????????

????????????????????????У???? Unix ?? join ?????????????????????????? uniq????????????????????????????????????????(???????????)?? 20:41 ????????????? 9:53 ?????????????????????衣

????1. ??????????????????

???????????????????????????????Σ?????????????ν?????????????????????? Unix ??????????????????????????????????

??????????? SQL ???????????浽??? commits_week.txt ?С?

 commits_week.txt

??????????? SQL ???????????浽 project_commits.txt ????У?

 project_commits.txt

?????????????????????????????

????-rw-r–r– 1 dds dds 15G Aug 4 21:09 commits_week.txt

????-rw-r–r– 1 dds dds 93G Aug 5 00:36 project_commits.txt

????????????治??????? –quick ????????? mysql ???????????????????????????????????е?????

????2. ??? Unix ?????й?????????

????????????????? Unix ?? join ??????????????????????????????????????????????????????????????????????????????????е?????????????????????????ú?????????? I/O ?????????????????????? uniq???????????????????????????????е? distinct ??????????????????????????????????????????????????????

?????????????е? Unix ???

????join commits_week.txt project_commits.txt | uniq >joined_commits.txt

???????????С??????????????????????

????-rw-r–r– 1 dds dds 133G Aug 5 01:40 joined_commits.txt

????3. ?????????????????

?????????????????????????

???????????????

????????

?????????MariaDB ????????????do??????????????£???????????????????????????????????????????????????????????????????????????????????????????????Unix ??????????MariaDB SQL?????????????????????????????????????????????

Tag????? MariaDB SQL?? Unix??????
About IT165 - ?????? - ??????? - ??????? - ???????? - ?????? - ??????? - ??????
??????????????????,???????????缼????,??????????????????