Mysql 最佳化之庫表設計,mysql最佳化庫表

來源:互聯網
上載者:User

Mysql 最佳化之庫表設計,mysql最佳化庫表

定長與變長分離

常用與不常用列分離

例如:


這張表不夠好,可以最佳化

分析:這張表除了username/intro列之外,每一列都是定長的.

我們不妨讓其所有列,都定長,可以極大提高查詢速度.

Username char(10) 是會造成空間的浪費,但是提高的速度,值.

Intro char(1500) 卻浪費的太多了,另一方面,人的簡介,一旦註冊完,改的頻率也並不高.

我們可以把 intro列單獨拿出來,另放一張表裡.




相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.