ä¸ãç´¢å¼
ç´¢å¼æ¯åå¨å¼æç¨äºå¿«éæ¥æ¾è®°å½çä¸ç§æ°æ®ç»æãæè§å¾æ°æ®åºä¸æéè¦çç¥è¯ç¹ï¼å°±æ¯ç´¢å¼ã
åå¨å¼æ以ä¸åçæ¹å¼ä½¿ç¨B-Treeç´¢å¼ï¼æ§è½ä¹åæä¸åï¼åæä¼å£ãä¾å¦MyISAM使ç¨åç¼å缩ææ¯ä½¿å¾ç´¢å¼æ´å°ï¼ä½InnoDBåæç §åæ°æ®æ ¼å¼è¿è¡åå¨ãMyISAMç´¢å¼éè¿æ°æ®çç©çä½ç½®å¼ç¨è¢«ç´¢å¼çè¡ï¼èInnoDBåæ ¹æ®ä¸»é®å¼ç¨è¢«ç´¢å¼çè¡ã
B-Treeé常æå³çææçå¼é½æ¯æ顺åºåå¨çï¼å¹¶ä¸æ¯ä¸ä¸ªå¶å页å°æ ¹çè·ç¦»ç¸åã
B-Treeç´¢å¼è½å¤å 快访é®æ°æ®çé度ï¼å 为åå¨å¼æä¸åéè¦è¿è¡å ¨è¡¨æ«ææ¥è·åéè¦çæ°æ®ï¼åè代ä¹çæ¯ä»ç´¢å¼çæ ¹ç»ç¹å¼å§è¿è¡æç´¢ãæ ¹ç»ç¹ç槽ä¸åæ¾äºæååç»ç¹çæéï¼åå¨å¼ææ ¹æ®è¿äºæéåä¸å±æ¥æ¾ãéè¿æ¯è¾èç¹é¡µçå¼åè¦æ¥æ¾çå¼å¯ä»¥æ¾å°åéçæéè¿å ¥ä¸å±åèç¹ï¼è¿äºæéå®é ä¸å®ä¹äºåèç¹é¡µä¸å¼çä¸éåä¸éãæç»åå¨å¼æè¦ä¹æ¾å°å¯¹åºçå¼ï¼è¦ä¹è¯¥è®°å½ä¸åå¨ã
å¶åèç¹æ¯è¾ç¹å«ï¼å®ä»¬çæéæåçæ¯è¢«ç´¢å¼çæ°æ®ï¼èä¸æ¯å ¶ä»çèç¹é¡µãB-Tree对索å¼åæ¯é¡ºåºç»ç»åå¨çï¼ææå¾éåæ¥æ¾èå´æ°æ®ãB-Treeéç¨äºå ¨é®å¼ãé®å¼èå´æé®åç¼æ¥æ¾ã å 为索å¼æ ä¸çèç¹æ¯æåºçï¼æ以é¤äºæå¼æ¥æ¾ä¹å¤ï¼ç´¢å¼è¿å¯ä»¥ç¨äºæ¥è¯¢ä¸çorder byæä½ãä¸è¬æ¥è¯´ï¼å¦æB-Treeå¯ä»¥æç §æç§æ¹å¼æ¥æ¾å°å¼ï¼é£ä¹ä¹å¯ä»¥æç §è¿ç§æ¹å¼ç¨äºæåºã
äºãç´¢å¼çä¼ç¹
- ç´¢å¼å¤§å¤§åå°äºæå¡å¨éè¦æ«æçæ°æ®éï¼
- ç´¢å¼å¯ä»¥å¸®å©æå¡å¨é¿å æåºå临æ¶è¡¨ï¼
- ç´¢å¼å¯ä»¥å°éæºIOå为顺åºIOï¼
ä¸ãåå¸ç´¢å¼
åå¸ç´¢å¼æ¯åºäºåå¸è¡¨å®ç°çï¼åªæ精确å¹é ç´¢å¼ææåçæ¥è¯¢æä¼çæã对äºæ¯ä¸è¡æ°æ®ï¼åå¨å¼æé½ä¼å¯¹ææçç´¢å¼å计ç®ä¸ä¸ªåå¸ç ï¼åå¸ç æ¯ä¸ä¸ªè¾å°çå¼ï¼å¹¶ä¸ä¸åé®å¼çè¡è®¡ç®åºæ¥çåå¸ç ä¹ä¸ä¸æ ·ãåå¸ç´¢å¼å°ææçåå¸ç åå¨å¨ç´¢å¼ä¸ï¼åæ¶åå¸è¡¨ä¸ä¿åæåæ¯ä¸ªæ°æ®è¡çæéã
å 为索å¼èªèº«åªéåå¨å¯¹åºçåå¸å¼ï¼æ以索å¼çç»æååç´§åï¼è¿ä¹è®©åå¸ç´¢å¼æ¥æ¾çé度é常快ã
åå¸ç´¢å¼ç缺ç¹ï¼
- åå¸ç´¢å¼æ æ³ç¨äºæåºï¼
- åå¸ç´¢å¼ä¸æ¯ææå·¦åç¼ååï¼
- åå¸ç´¢å¼åªæ¯æçå¼æ¯è¾ï¼ä¸æ¯æèå´æ¥è¯¢ï¼æ¯å¦where salary > 5000ï¼
InnoDBå¼ææä¸ä¸ªç¹æ®çåè½å«âèªéåºåå¸ç´¢å¼âãå½InnoDB注æå°æäºç´¢å¼å¼è¢«ä½¿ç¨å¾é常é¢ç¹æ¶ï¼å®ä¼å¨å åä¸åºäºB-Treeç´¢å¼ä¹ä¸åå建ä¸ä¸ªåå¸ç´¢å¼ï¼è¿å°±è®©B-Treeç´¢å¼ä¹å ·æåå¸ç´¢å¼çä¸äºä¼ç¹ãè¿æ¯ä¸ä¸ªå®å ¨èªå¨çãå é¨çè¡ä¸ºï¼ç¨æ·æ æ³æ§å¶æé ç½®ã
åãåå¸ç´¢å¼å®ä¾
å¦æä¸ä¸ªè¡¨éè¦åå¨å¤§éçURLï¼å¹¶éè¦æ ¹æ®URLè¿è¡æç´¢æ¥æ¾ï¼å¦æ使ç¨B-Treeæ¥åå¨URLï¼åå¨çå 容就ä¼å¾å¤§ï¼å 为URLæ¬èº«å°±å¾é¿ï¼æ£å¸¸æ åµä¸ä¼æå¦ä¸æ¥è¯¢ï¼
select id,name from url where url = "http://www.baidu.com";
è¥å é¤åæ¥URLåä¸çç´¢å¼ï¼èæ°å¢ä¸ä¸ªè¢«ç´¢å¼çurl-srcåï¼ä½¿ç¨SRC32ååå¸ï¼å°±å¯ä»¥ä½¿ç¨ä¸é¢çæ¹å¼æ¥è¯¢ï¼
select id,name from url where url = "http://www.baidu.com" and url_crc = CRC32("http://www.baidu.com");
è¿æ ·åçè¯ï¼æ§è½ä¼æé«å¾å¤ï¼éè¿url_crcåè¿è¡åå¸æ¥æ¾ã
è¿æ ·å®ç°ç缺ç¹æ¯éè¦ç»´æ¤åå¸å¼ï¼å¯ä»¥æå¨ç»´æ¤ï¼ä¹å¯ä»¥ä½¿ç¨è§¦åå¨å®ç°ã
äºãåç¼ç´¢å¼
1ãç¬ç«çå
ç¬ç«çåæ¯æç´¢å¼åä¸è½æ¯è¡¨è¾¾å¼çä¸é¨åï¼ä¹ä¸è½æ¯å½æ°çåæ°ï¼å¿ é¡»æ¯çå·ååç¬çååå¨ã
2ãåç¼ç´¢å¼åç´¢å¼éæ©æ§
é常å¯ä»¥æ¿å符串å¼å§çé¨åå符å½ç´¢å¼ï¼è¿æ ·å¯ä»¥å¤§å¤§è约索å¼ç©ºé´ï¼ä»èæé«ç´¢å¼æçãç´¢å¼çéæ©æ§è¶é«åæ¥è¯¢æçè¶é«ï¼éæ©æ§é«çç´¢å¼å¯ä»¥è®©MySQLå¨æ¥æ¾æ¶è¿æ»¤ææ´å¤çè¡ã
ä¸è¬æ åµä¸ï¼å¯¹äºblobãtextãvarcharç±»åçåï¼å¿ 须使ç¨åç¼ç´¢å¼ï¼å 为MySQLä¸å 许索å¼è¿äºåçå®æ´é¿åº¦ãè¯çªå¨äºéæ©è¶³å¤é¿çåç¼ä»¥ä¿è¯è¾é«çç´¢å¼éæ©æ§ï¼åæ¶åä¸è½å¤ªé¿ï¼æ好使å¾åç¼ç´¢å¼çéæ©æ§æ¥è¿äºç´¢å¼æ´ä¸ªåã
为äºå³å®åç¼çåéé¿åº¦ï¼éè¦æ¾å°æ常è§çå¼çå表ï¼ç¶ååæ常è§çåç¼å表è¿è¡æ¯è¾ã
使ç¨MySQLå®æ¹æ°æ®åºæä¾ç表ï¼
CREATE TABLE city (
city_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
city VARCHAR(50) NOT NULL,
country_id SMALLINT UNSIGNED NOT NULL,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (city_id),
KEY idx_fk_country_id (country_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ç¨cityåæµè¯ä¸ä¸å¦ä½ä½¿ç¨åç¼ç´¢å¼ã
3ãéè¿sqlè·åcityå ¨åçç´¢å¼éæ©æ§
select count(distinct city) / count(*) FROM city;
å¯ä»¥çå°ï¼ç»æ为 0.9968ï¼è¯´æè¿ä¸åçå¼æ¯æéå¤çã
4ãæªåcityåï¼è·ååéçç´¢å¼éæ©æ§
ç°å¨éè¿æªåcityåï¼æ¥æµè¯ä¸ä¸ä»ä»¬çç´¢å¼éæ©æ§ï¼ä½¿åç¼çéæ©æ§æ¥è¿äºå®æ´åçéæ©æ§å°±å¯ä»¥äºã
SELECT
COUNT(DISTINCT LEFT(city,3))/COUNT(*) AS pref3,
COUNT(DISTINCT LEFT(city,5))/COUNT(*) AS pref5,
COUNT(DISTINCT LEFT(city,7))/COUNT(*) AS pref7,
COUNT(DISTINCT LEFT(city,9))/COUNT(*) AS pref9,
COUNT(DISTINCT LEFT(city,11))/COUNT(*) AS pref11,
COUNT(DISTINCT LEFT(city,13))/COUNT(*) AS pref13,
COUNT(DISTINCT LEFT(city,14))/COUNT(*) AS pref14,
COUNT(DISTINCT LEFT(city,15))/COUNT(*) AS pref15
FROM city;
æè§å¾æªå5个çæ¶åå°±å¯ä»¥äºï¼è¿ä¸ªæ¶ååå¢å åç¼é¿åº¦ï¼éæ©æ§çæåå·²ç»ä¸ææ¾äºãä½æ¯å¦ææ°æ®åå¸å¾ä¸ååï¼å¯è½å°±ä¼æé®é¢ï¼
5ãéè¿sqlæµè¯ä¸ä¸
select count(1) as cnt,left(city,5) as pref from city group by pref order by cnt desc limit 5
å·²ç»æ¾å°äºåéçåç¼é¿åº¦ï¼ä¸é¢å建åç¼ç´¢å¼ï¼
alter table city add key city_idx(city(5));
åç¼ç´¢å¼æ¯ä¸ç§è½ä½¿ç´¢å¼æ´å°ãæ´å¿«çæ¹å¼ï¼ä½MySQLä¸æ æ³ä½¿ç¨åç¼ç´¢å¼åorder by ågroup by ï¼ä¹æ æ³ä½¿ç¨åç¼ç´¢å¼åè¦çæ«æã
6ãæµè¯ä¸ä¸æ¯å¦å¯ä»¥è§¦åç´¢å¼
explain select city_id,city,last_update from city where city = 'dalian'
触åäºcity_idxç´¢å¼ã
å ãexplainæ¥è¯¢ç»æç®ä»
1ãidï¼SELECTè¯å«ç¬¦ã
è¿æ¯SELECTçæ¥è¯¢åºåå·ã
2ãselect_typeï¼SELECTç±»åï¼
- SIMPLEï¼ ç®åSELECT(ä¸ä½¿ç¨UNIONæåæ¥è¯¢)ï¼
- PRIMARYï¼ æå¤é¢çSELECTï¼
- UNIONï¼UNIONä¸ç第äºä¸ªæåé¢çSELECTè¯å¥ï¼
- DEPENDENT UNIONï¼UNIONä¸ç第äºä¸ªæåé¢çSELECTè¯å¥ï¼åå³äºå¤é¢çæ¥è¯¢ï¼
- UNION RESULTï¼UNIONçç»æï¼
- SUBQUERYï¼åæ¥è¯¢ä¸ç第ä¸ä¸ªSELECTï¼
- DEPENDENT SUBQUERYï¼åæ¥è¯¢ä¸ç第ä¸ä¸ªSELECTï¼åå³äºå¤é¢çæ¥è¯¢ï¼
- DERIVEDï¼å¯¼åºè¡¨çSELECT(FROMåå¥çåæ¥è¯¢)ï¼
3ãtableï¼è¡¨å
4ãtypeï¼èæ¥ç±»å
- systemï¼è¡¨ä» æä¸è¡(=ç³»ç»è¡¨)ãè¿æ¯constèæ¥ç±»åçä¸ä¸ªç¹ä¾ï¼
- constï¼è¡¨æå¤æä¸ä¸ªå¹é è¡ï¼å®å°å¨æ¥è¯¢å¼å§æ¶è¢«è¯»åãå ä¸ºä» æä¸è¡ï¼å¨è¿è¡çåå¼å¯è¢«ä¼åå¨å©ä½é¨å认为æ¯å¸¸æ°ãconstç¨äºç¨å¸¸æ°å¼æ¯è¾PRIMARY KEYæUNIQUEç´¢å¼çææé¨åæ¶ï¼
- eq_refï¼å¯¹äºæ¯ä¸ªæ¥èªäºåé¢ç表çè¡ç»åï¼ä»è¯¥è¡¨ä¸è¯»åä¸è¡ãè¿å¯è½æ¯æ好çèæ¥ç±»åï¼é¤äºconstç±»åãå®ç¨å¨ä¸ä¸ªç´¢å¼çææé¨å被èæ¥ä½¿ç¨å¹¶ä¸ç´¢å¼æ¯UNIQUEæPRIMARY KEYãeq_refå¯ä»¥ç¨äºä½¿ç¨= æä½ç¬¦æ¯è¾ç带索å¼çåãæ¯è¾å¼å¯ä»¥ä¸ºå¸¸éæä¸ä¸ªä½¿ç¨å¨è¯¥è¡¨åé¢æ读åç表çåç表达å¼ï¼
- refï¼å¯¹äºæ¯ä¸ªæ¥èªäºåé¢ç表çè¡ç»åï¼æææå¹é ç´¢å¼å¼çè¡å°ä»è¿å¼ 表ä¸è¯»åãå¦æèæ¥åªä½¿ç¨é®çæ左边çåç¼ï¼æå¦æé®ä¸æ¯UNIQUEæPRIMARY KEY(æ¢å¥è¯è¯´ï¼å¦æèæ¥ä¸è½åºäºå ³é®åéæ©å个è¡çè¯)ï¼å使ç¨refãå¦æ使ç¨çé®ä» ä» å¹é å°éè¡ï¼è¯¥èæ¥ç±»åæ¯ä¸éçãrefå¯ä»¥ç¨äºä½¿ç¨=æ<=>æä½ç¬¦ç带索å¼çåï¼
- ref_or_nullï¼è¯¥èæ¥ç±»åå¦årefï¼ä½æ¯æ·»å äºMySQLå¯ä»¥ä¸é¨æç´¢å å«NULLå¼çè¡ãå¨è§£å³åæ¥è¯¢ä¸ç»å¸¸ä½¿ç¨è¯¥èæ¥ç±»åçä¼åï¼
- index_mergeï¼è¯¥èæ¥ç±»å表示使ç¨äºç´¢å¼å并ä¼åæ¹æ³ãå¨è¿ç§æ åµä¸ï¼keyåå å«äºä½¿ç¨çç´¢å¼çæ¸ åï¼key_lenå å«äºä½¿ç¨çç´¢å¼çæé¿çå ³é®å ç´ ï¼
- unique_subqueryï¼è¯¥ç±»åæ¿æ¢äºä¸é¢å½¢å¼çINåæ¥è¯¢çrefï¼value IN (SELECT primary_key FROMsingle_table WHERE some_expr);unique_subqueryæ¯ä¸ä¸ªç´¢å¼æ¥æ¾å½æ°ï¼å¯ä»¥å®å ¨æ¿æ¢åæ¥è¯¢ï¼æçæ´é«ï¼
- index_subqueryï¼è¯¥èæ¥ç±»å类似äºunique_subqueryãå¯ä»¥æ¿æ¢INåæ¥è¯¢ï¼ä½åªéåä¸åå½¢å¼çåæ¥è¯¢ä¸çéå¯ä¸ç´¢å¼ï¼value IN (SELECT key_column FROM single_table WHERE some_exprï¼
- rangeï¼åªæ£ç´¢ç»å®èå´çè¡ï¼ä½¿ç¨ä¸ä¸ªç´¢å¼æ¥éæ©è¡ãkeyåæ¾ç¤ºä½¿ç¨äºåªä¸ªç´¢å¼ãkey_lenå å«æ使ç¨ç´¢å¼çæé¿å ³é®å ç´ ãå¨è¯¥ç±»åä¸refå为NULLãå½ä½¿ç¨=ã<>ã>ã>=ã<ã<=ãIS NULLã<=>ãBETWEENæè INæä½ç¬¦ï¼ç¨å¸¸éæ¯è¾å ³é®ååæ¶ï¼å¯ä»¥ä½¿ç¨rangï¼
- indexï¼è¯¥èæ¥ç±»åä¸ALLç¸åï¼é¤äºåªæç´¢å¼æ 被æ«æãè¿é常æ¯ALLå¿«ï¼å 为索å¼æ件é常æ¯æ°æ®æ件å°ï¼
- allï¼å¯¹äºæ¯ä¸ªæ¥èªäºå åç表çè¡ç»åï¼è¿è¡å®æ´ç表æ«æãå¦æ表æ¯ç¬¬ä¸ä¸ªæ²¡æ è®°constç表ï¼è¿é常ä¸å¥½ï¼å¹¶ä¸é常å¨å®æ åµä¸å¾å·®ãé常å¯ä»¥å¢å æ´å¤çç´¢å¼èä¸è¦ä½¿ç¨ALLï¼ä½¿å¾è¡è½åºäºåé¢ç表ä¸ç常æ°å¼æåå¼è¢«æ£ç´¢åºã
5ãpossible_keys
possible_keysåæåºMySQLè½ä½¿ç¨åªä¸ªç´¢å¼å¨è¯¥è¡¨ä¸æ¾å°è¡ã注æï¼è¯¥åå®å ¨ç¬ç«äºEXPLAINè¾åºæ示ç表ç次åºãè¿æå³çå¨possible_keysä¸çæäºé®å®é ä¸ä¸è½æçæç表次åºä½¿ç¨ã
6ãkey
keyåæ¾ç¤ºMySQLå®é å³å®ä½¿ç¨çé®(ç´¢å¼)ãå¦æ没æéæ©ç´¢å¼ï¼é®æ¯NULLãè¦æ³å¼ºå¶MySQL使ç¨æ忽è§possible_keysåä¸çç´¢å¼ï¼å¨æ¥è¯¢ä¸ä½¿ç¨FORCE INDEXãUSE INDEXæè IGNORE INDEXã
7ãkey_len
key_lenåæ¾ç¤ºMySQLå³å®ä½¿ç¨çé®é¿åº¦ãå¦æé®æ¯NULLï¼åé¿åº¦ä¸ºNULLã
8ãref
refåæ¾ç¤ºä½¿ç¨åªä¸ªåæ常æ°ä¸keyä¸èµ·ä»è¡¨ä¸éæ©è¡ã
9ãrows
rowsåæ¾ç¤ºMySQL认为å®æ§è¡æ¥è¯¢æ¶å¿ é¡»æ£æ¥çè¡æ°ã
10ãExtra
该åå å«MySQL解å³æ¥è¯¢ç详ç»ä¿¡æ¯ã
- Distinctï¼MySQLåç°ç¬¬1个å¹é è¡åï¼åæ¢ä¸ºå½åçè¡ç»åæç´¢æ´å¤çè¡ï¼
- Not existsï¼MySQLè½å¤å¯¹æ¥è¯¢è¿è¡LEFT JOINä¼åï¼åç°1个å¹é LEFT JOINæ åçè¡åï¼ä¸å为åé¢çè¡ç»åå¨è¯¥è¡¨å æ£æ¥æ´å¤çè¡ï¼
- range checked for each record (index map: #)ï¼MySQL没æåç°å¥½çå¯ä»¥ä½¿ç¨çç´¢å¼ï¼ä½åç°å¦ææ¥èªåé¢ç表çåå¼å·²ç¥ï¼å¯è½é¨åç´¢å¼å¯ä»¥ä½¿ç¨ã对åé¢ç表çæ¯ä¸ªè¡ç»åï¼MySQLæ£æ¥æ¯å¦å¯ä»¥ä½¿ç¨rangeæindex_merge访é®æ¹æ³æ¥ç´¢åè¡ï¼
- Using filesortï¼MySQLéè¦é¢å¤çä¸æ¬¡ä¼ éï¼ä»¥æ¾åºå¦ä½ææåºé¡ºåºæ£ç´¢è¡ãéè¿æ ¹æ®èæ¥ç±»åæµè§ææè¡å¹¶ä¸ºææå¹é WHEREåå¥çè¡ä¿åæåºå ³é®ååè¡çæéæ¥å®ææåºãç¶åå ³é®å被æåºï¼å¹¶ææåºé¡ºåºæ£ç´¢è¡ï¼
- Using indexï¼ä»åªä½¿ç¨ç´¢å¼æ ä¸çä¿¡æ¯èä¸éè¦è¿ä¸æ¥æ索读åå®é çè¡æ¥æ£ç´¢è¡¨ä¸çåä¿¡æ¯ãå½æ¥è¯¢åªä½¿ç¨ä½ä¸ºåä¸ç´¢å¼ä¸é¨åçåæ¶ï¼å¯ä»¥ä½¿ç¨è¯¥çç¥ï¼
- Using temporaryï¼ä¸ºäºè§£å³æ¥è¯¢ï¼MySQLéè¦å建ä¸ä¸ªä¸´æ¶è¡¨æ¥å®¹çº³ç»æãå ¸åæ åµå¦æ¥è¯¢å å«å¯ä»¥æä¸åæ åµååºåçGROUP BYåORDER BYåå¥æ¶ï¼
- Using whereï¼WHEREåå¥ç¨äºéå¶åªä¸ä¸ªè¡å¹é ä¸ä¸ä¸ªè¡¨æåéå°å®¢æ·ãé¤éä½ ä¸é¨ä»è¡¨ä¸ç´¢åææ£æ¥ææè¡ï¼å¦æExtraå¼ä¸ä¸ºUsing where并ä¸è¡¨èæ¥ç±»å为ALLæindexï¼æ¥è¯¢å¯è½ä¼æä¸äºé误ï¼
- Using sort_union(...), Using union(...), Using intersect(...)ï¼è¿äºå½æ°è¯´æå¦ä½ä¸ºindex_mergeèæ¥ç±»åå并索å¼æ«æï¼
- Using index for group-byï¼ç±»ä¼¼äºè®¿é®è¡¨çUsing indexæ¹å¼ï¼Using index for group-by表示MySQLåç°äºä¸ä¸ªç´¢å¼ï¼å¯ä»¥ç¨æ¥æ¥è¯¢GROUP BYæDISTINCTæ¥è¯¢çææåï¼èä¸è¦é¢å¤æ索硬ç访é®å®é ç表ã并ä¸ï¼ææææçæ¹å¼ä½¿ç¨ç´¢å¼ï¼ä»¥ä¾¿å¯¹äºæ¯ä¸ªç»ï¼åªè¯»åå°éç´¢å¼æ¡ç®ã
éè¿ç¸ä¹EXPLAINè¾åºçrowsåçææå¼ï¼ä½ è½å¾å°ä¸ä¸ªå ³äºä¸ä¸ªèæ¥å¦ä½çæ示ãè¿åºè¯¥ç²ç¥å°åè¯ä½ MySQLå¿ é¡»æ£æ¥å¤å°è¡ä»¥æ§è¡æ¥è¯¢ãå½ä½ 使ç¨max_join_sizeåééå¶æ¥è¯¢æ¶ï¼ä¹ç¨è¿ä¸ªä¹ç§¯æ¥ç¡®å®æ§è¡åªä¸ªå¤è¡¨SELECTè¯å¥ã