- 26.1 MySQL 分区概览26.1 Overview of Partitioning in MySQL
- 26.2 分区类型26.2 Partitioning Types
- 26.3 分区管理26.3 Partition Management
- 26.3.1 RANGE 和 LIST 分区的管理26.3.1 Management of RANGE and LIST Partitions
- 26.3.2 HASH 和 KEY 分区的管理26.3.2 Management of HASH and KEY Partitions
- 26.3.3 分区与子分区与表的交换26.3.3 Exchanging Partitions and Subpartitions with Tables
- 26.3.4 分区维护26.3.4 Maintenance of Partitions
- 26.3.5 获取分区信息26.3.5 Obtaining Information About Partitions
- 26.4 分区修剪26.4 Partition Pruning
- 26.5 分区选择26.5 Partition Selection
- 26.6 分区的限制和局限性26.6 Restrictions and Limitations on Partitioning
本章讨论 用户定义的分区。This chapter discusses user-defined partitioning.
表分区不同于窗口函数使用的分区。有关窗口函数的信息,请参见 第 14.20 节,“窗口函数”。Table partitioning differs from partitioning as used by window functions. For information about window functions, see Section 14.20, “Window Functions”.
在 MySQL 8.4 中,分区支持由 InnoDB 和 NDB 存储引擎提供。In MySQL 8.4, partitioning support is provided by the
InnoDB and
NDB storage engines.
MySQL 8.4 目前不支持使用除 InnoDB 或 NDB 之外的任何存储引擎对表进行分区,例如 MyISAM。尝试使用不提供原生分区支持的存储引擎创建分区表会失败,并出现 ER_CHECK_NOT_IMPLEMENTED 错误。MySQL 8.4 does not currently support partitioning of
tables using any storage engine other than InnoDB
or NDB, such as
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.
如果您是从源码编译 MySQL 8.4,只需配置构建以支持 InnoDB,即可生成支持 InnoDB 表分区的二进制文件。有关更多信息,请参见 第 2.8 节,“从源码安装 MySQL”。If you are compiling MySQL 8.4 from source, configuring
the build with InnoDB support is sufficient to
produce binaries with partition support for
InnoDB tables. For more information, see
Section 2.8, “Installing MySQL from Source”.
无需进一步操作即可启用 InnoDB 的分区支持(例如,在 my.cnf 文件中不需要额外条目)。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 存储引擎的分区支持。It is not possible to disable partitioning support by the
InnoDB storage engine.
有关分区及分区概念的介绍,请参见 第 26.1 节,“MySQL 中的分区概述”。See Section 26.1, “Overview of Partitioning in MySQL”, for an introduction to partitioning and partitioning concepts.
支持多种分区类型,以及子分区;参见 第 26.2 节,“分区类型”,以及 第 26.2.6 节,“子分区”。Several types of partitioning are supported, as well as subpartitioning; see Section 26.2, “Partitioning Types”, and Section 26.2.6, “Subpartitioning”.
第 26.3 节,“分区管理”,涵盖了在现有分区表中添加、删除和修改分区的方法。Section 26.3, “Partition Management”, covers methods of adding, removing, and altering partitions in existing partitioned tables.
第 26.3.4 节,“分区维护”,讨论了用于分区表的表维护命令。Section 26.3.4, “Maintenance of Partitions”, discusses table maintenance commands for use with partitioned tables.
INFORMATION_SCHEMA 数据库中的 PARTITIONS 表提供有关分区和分区表的信息。更多信息请参见 第 28.3.21 节,“INFORMATION_SCHEMA PARTITIONS 表”;有关针对该表的一些查询示例,请参见 第 26.2.7 节,“MySQL 分区如何处理 NULL”。The PARTITIONS table in the
INFORMATION_SCHEMA database provides information
about partitions and partitioned tables. See
Section 28.3.21, “The INFORMATION_SCHEMA PARTITIONS Table”, for more
information; for some examples of queries against this table, see
Section 26.2.7, “How MySQL Partitioning Handles NULL”.
有关 MySQL 8.4 分区的已知问题,请参见 第 26.6 节,“分区的限制和局限”。For known issues with partitioning in MySQL 8.4, see Section 26.6, “Restrictions and Limitations on Partitioning”.
在使用分区表时,您还可能会发现以下资源非常有用。You may also find the following resources to be useful when working with partitioned tables.
附加资源。 关于 MySQL 用户定义分区的其他信息来源包括以下内容:Additional Resources. Other sources of information about user-defined partitioning in MySQL include the following:
MySQL 分区论坛MySQL Partitioning Forum
这是官方讨论论坛,面向对 MySQL 分区技术感兴趣或正在尝试的用户。论坛包含 MySQL 开发者及其他人员的公告和更新。分区开发和文档团队的成员也会进行监控。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 分区的人员维护的博客,或者将您自己的博客加入到涵盖的内容中。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.