开发者

Is it worth to partition a MySQL table on a key, if this key is already an index?

开发者 https://www.devze.com 2023-04-03 19:01 出处:网络
I have a big MySQL table (around 50 GB, tens of millions of records), with one index key (a foreign key) that has around 2000 possible d开发者_开发百科ifferent values, and another index key (a VARCHAR

I have a big MySQL table (around 50 GB, tens of millions of records), with one index key (a foreign key) that has around 2000 possible d开发者_开发百科ifferent values, and another index key (a VARCHAR(2)) that has 3 possible values.

Can I expect a significant performance increase if I partition the table based on either (or both) indices?


You can't partition on a column that is not an index (or part of it), so yeah... it is worth it.


Have you thought of de-normalising the table when there is three possible values if you have performance problems?

0

精彩评论

暂无评论...
验证码 换一张
取 消