07索引

微放發表於2024-10-19

索引

image-20240918161311978

image-20240918161433111

image-20240918161831079

image-20240918162005214

image-20240918163823860

image-20240918162327626

image-20240918163204270

image-20240918163310922

image-20240918163745372

image-20240918164308553

image-20240919151645905

image-20240919152246974

image-20240919152417711

image-20240919155517660

image-20240919155916271

image-20240919160507352

image-20240919162632371

image-20240919162137086

image-20240919162413005

索引失效的情況

image-20240920152335504

image-20240920153350472

image-20240920153716621

image-20240920153859024

image-20240920154049219

image-20240920154402299

image-20240920154830170

image-20240920155448143

image-20240920160137246

image-20240920160511284

所查詢的資料在索引中都有就叫覆蓋索引

image-20240920160635161

所以當使用select *時非常容易出現回表查詢,效能就會降低

image-20240920163427375

字首取多少個,取決於需求,根據需求確定選擇性

選擇性不重複的個數/總數

使用字首索引可以降低索引體積,提高索引效率

image-20240920164030236

image-20240920164648624

相關文章