简体   繁体   English

MySQL是否支持垂直分区?

[英]Does mysql support vertical partitioning?

I have a mysql database growing @ 45-50% a year. 我有一个MySQL数据库,每年以45-50%的速度增长。 In last couple of years it has increased to a significant amount in size and now causing performance issues in production. 在过去的几年中,它的规模已大大增加,现在在生产中引起性能问题。

While analyzing it on test environment I found that there is a table which has around 20 columns with 4-5 columns of type longtext. 在测试环境上进行分析时,我发现有一个表,该表大约有20列,其中4-5列为longtext类型。 This has around 1.8M records and is being frequently accessed by application. 它大约有180万条记录,并且经常被应用程序访问。 I have gone through many mysql performance blogs and got a sense that vertical partitioning may help in this case so thought to give it a try with manually breaking the table in two parts with all logntext columns in one table and other columns in another table with both tables mapped by primary key and observed 80% performance improvement for the same query which was causing the issue. 我遍历了许多mysql性能博客,并感觉到垂直分区在这种情况下可能会有所帮助,因此可以尝试一下手动将表分为两部分,其中所有logntext列在一个表中,而其他列在另一个表中,由主键映射的表,对于引起问题的同一查询,观察到性能提高了80%。

Now, I am not sure if I can achieve vertical partitioning at database level without breaking table manually as if I go with manual option it will require a lot of changes in code and queries which could result in some other surprises on production. 现在,我不确定是否可以在不手动破坏表的情况下实现数据库级别的垂直分区,就像我使用手动选项一样,它将需要对代码和查询进行大量更改,这可能会给生产带来其他惊喜。

Please suggest if MySql actually supports vertical partitioning at database level. 请建议MySql是否实际上支持数据库级别的垂直分区。 I tried to google it but found examples of horizontal partitioning only, no references to vertical partitioning. 我试图用谷歌搜索它,但是只发现了水平分区的例子,没有引用垂直分区。 Appreciate your help on this. 感谢您的帮助。

PS I am not a database professional so everything I did is based on suggestions/feedback on MySql blogs/forums. PS我不是数据库专业人员,所以我所做的一切都是基于MySql博客/论坛上的建议/反馈。

Thanks 谢谢

mysql does not support vertical partitioning mysql不支持垂直分区

https://dev.mysql.com/doc/refman/5.7/en/partitioning-overview.html https://dev.mysql.com/doc/refman/5.7/en/partitioning-overview.html

MySQL 5.7 does not support vertical partitioning, in which different columns of a table are assigned to different physical partitions. MySQL 5.7不支持垂直分区,在垂直分区中,表的不同列被分配给不同的物理分区。 There are no plans at this time to introduce vertical partitioning into MySQL. 目前尚无计划将垂直分区引入MySQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM