Table of Contents
This chapter discusses user-defined partitioning.本章讨论用户定义的分区。
Table partitioning differs from partitioning as used by window functions. For information about window functions, see Section 12.21, “Window Functions”.表分区与窗口函数使用的分区不同。有关窗口功能的信息,请参阅第12.21节,“窗口函数”。
In MySQL 8.0, partitioning support is provided by the 在MySQL 8.0中,分区支持由InnoDB
and NDB
storage engines.InnoDB
和NDB存储引擎提供。
MySQL 8.0 does not currently support partitioning of tables using any storage engine other than MySQL 8.0目前不支持使用InnoDB
or NDB
, such as MyISAM
. InnoDB
或NDB以外的任何存储引擎(如MyISAM
)对表进行分区。An attempt to create a partitioned tables using a storage engine that does not supply native partitioning support fails with ER_CHECK_NOT_IMPLEMENTED.尝试使用不提供本机分区支持的存储引擎创建分区表时失败,返回ER_CHECK_not_IMPLEMENTED。
MySQL 8.0 Community binaries provided by Oracle include partitioning support provided by the Oracle提供的MySQL 8.0社区二进制文件包括InnoDB
and NDB
storage engines. InnoDB
和NDB
存储引擎提供的分区支持。For information about partitioning support offered in MySQL Enterprise Edition binaries, see Chapter 30, MySQL Enterprise Edition.有关MySQL Enterprise Edition二进制文件中提供的分区支持的信息,请参阅第30章,“MySQL企业版”。
If you are compiling MySQL 8.0 from source, configuring the build with 如果您是从源代码编译MySQL 8.0,那么使用InnoDB
support is sufficient to produce binaries with partition support for InnoDB
tables. InnoDB
支持配置构建就足以生成支持InnoDB
表分区的二进制文件。For more information, see Section 2.9, “Installing MySQL from Source”.有关更多信息,请参阅第2.9节,“从源代码安装MySQL”。
Nothing further needs to be done to enable partitioning support by 不需要做任何进一步的事情来启用InnoDB
(for example, no special entries are required in the my.cnf
file).InnoDB
的分区支持(例如,my.cnf
文件中不需要特殊的条目)。
It is not possible to disable partitioning support by the InnoDB
storage engine.InnoDB
存储引擎不可能禁用分区支持。
See Section 24.1, “Overview of Partitioning in MySQL”, for an introduction to partitioning and partitioning concepts.有关分区和分区概念的介绍,请参阅第24.1节,“MySQL中的分区概述”。
Several types of partitioning are supported, as well as subpartitioning; see Section 24.2, “Partitioning Types”, and Section 24.2.6, “Subpartitioning”.支持多种类型的分区以及子分区;参见第24.2节,“分区类型”和第24.2.6节,“细分”。
Section 24.3, “Partition Management”, covers methods of adding, removing, and altering partitions in existing partitioned tables.第24.3节,“分区管理”涵盖了在现有分区表中添加、删除和更改分区的方法。
Section 24.3.4, “Maintenance of Partitions”, discusses table maintenance commands for use with partitioned tables.第24.3.4节,“分区的维护”讨论了用于分区表的表维护命令。
The PARTITIONS
table in the INFORMATION_SCHEMA
database provides information about partitions and partitioned tables. INFORMATION_SCHEMA
数据库中的PARTITIONS
表提供了有关分区和分区表的信息。See Section 26.3.21, “The INFORMATION_SCHEMA PARTITIONS Table”, for more information; for some examples of queries against this table, see Section 24.2.7, “How MySQL Partitioning Handles NULL”.有关更多信息,请参阅第26.3.21节,“INFORMATION_SCHEMA PARTITIONS表”;有关针对该表的一些查询示例,请参阅第24.2.7节,“MySQL分区如何处理NULL
”。
For known issues with partitioning in MySQL 8.0, see Section 24.6, “Restrictions and Limitations on Partitioning”.有关MySQL 8.0中分区的已知问题,请参阅第24.6节,“分区的限制和限制”。
You may also find the following resources to be useful when working with partitioned tables.在处理分区表时,您可能还会发现以下资源非常有用。
Additional Resources.额外资源。 Other sources of information about user-defined partitioning in MySQL include the following:MySQL中有关用户定义分区的其他信息来源包括:
MySQL Partitioning ForumMySQL分区论坛
This is the official discussion forum for those interested in or experimenting with MySQL Partitioning technology. It features announcements and updates from MySQL developers and others. It is monitored by members of the Partitioning Development and Documentation Teams.这是那些对MySQL分区技术感兴趣或尝试MySQL分区技术的人的官方讨论论坛。它以MySQL开发人员和其他人的公告和更新为特色。它由分区开发和文档团队的成员进行监控。
MySQL Partitioning Architect and Lead Developer Mikael Ronström frequently posts articles here concerning his work with MySQL Partitioning and NDB Cluster.MySQL分区架构师和首席开发人员Mikael Ronstrm经常在这里发布关于他在MySQL分区和NDB集群方面的工作的文章。
A MySQL news site featuring MySQL-related blogs, which should be of interest to anyone using my MySQL. We encourage you to check here for links to blogs kept by those working with MySQL Partitioning, or to have your own blog added to those covered.一个MySQL新闻网站,以MySQL相关博客为特色,任何使用我的MySQL的人都应该对此感兴趣。我们鼓励您在这里查看MySQL分区工作人员保存的博客链接,或者将您自己的博客添加到所涵盖的博客中。