8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / MySQL Glossary
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 93%

MySQL 术语表MySQL Glossary

这些术语通常用于有关 MySQL 数据库服务器的信息中。These terms are commonly used in information about the MySQL database server.

AA

.ARM 文件.ARM file

用于 ARCHIVE 表的元数据。与 .ARZ 文件 相对。具有此扩展名的文件总是包括在 MySQL 企业备份 产品的 mysqlbackup 命令生成的备份中。 Metadata for ARCHIVE tables. Contrast with .ARZ file. Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product.

另请参见 .ARZ 文件、MySQL 企业备份、mysqlbackup 命令。See Also .ARZ file, MySQL Enterprise Backup, mysqlbackup command.

.ARZ 文件.ARZ file

ARCHIVE 表的数据。与 .ARM 文件 形成对比。具有此扩展名的文件总是包含在由 MySQL Enterprise Backup 产品的 mysqlbackup 命令生成的备份中。 Data for ARCHIVE tables. Contrast with .ARM file. Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product.

另请参见 .ARM 文件、MySQL Enterprise Backup、mysqlbackup 命令。See Also .ARM file, MySQL Enterprise Backup, mysqlbackup command.

符合ACID

一个缩写,代表原子性、一致性、隔离性和持久性。这些特性在数据库系统中都是理想的,并且都与事务的概念密切相关。InnoDB的事务特性遵循 ACID 原则。 An acronym standing for atomicity, consistency, isolation, and durability. These properties are all desirable in a database system, and are all closely tied to the notion of a transaction. The transactional features of InnoDB adhere to the ACID principles.

事务是可以被提交或回滚的原子工作单元。当一个事务对数据库进行多次更改时,要么在事务提交时所有更改都成功,要么在事务回滚时所有更改都被撤销。Transactions are atomic units of work that can be committed or rolled back. When a transaction makes multiple changes to the database, either all the changes succeed when the transaction is committed, or all the changes are undone when the transaction is rolled back.

数据库在任何时候都保持一致状态——在每次提交或回滚之后,以及在事务进行过程中。如果相关数据在多个表中被更新,查询看到的要么是所有旧值,要么是所有新值,而不是旧值和新值的混合。The database remains in a consistent state at all times — after each commit or rollback, and while transactions are in progress. If related data is being updated across multiple tables, queries see either all old values or all new values, not a mix of old and new values.

事务在进行时彼此之间受到保护(隔离);它们不能相互干扰,也不能看到彼此未提交的数据。这种隔离是通过锁定机制实现的。经验丰富的用户可以调整隔离级别,以在确信事务确实不会互相干扰的情况下,以牺牲部分保护为代价换取更高的性能和并发性。Transactions are protected (isolated) from each other while they are in progress; they cannot interfere with each other or see each other's uncommitted data. This isolation is achieved through the locking mechanism. Experienced users can adjust the isolation level, trading off less protection in favor of increased performance and concurrency, when they can be sure that the transactions really do not interfere with each other.

事务的结果是持久的:一旦提交操作成功,该事务所做的更改就能免受断电、系统崩溃、竞争条件或其他许多非数据库应用可能面临的潜在危险的影响。持久性通常涉及写入磁盘存储,并具有一定程度的冗余,以防在写入操作期间出现断电或软件崩溃。(在InnoDB中,双写缓冲区有助于持久性。)The results of transactions are durable: once a commit operation succeeds, the changes made by that transaction are safe from power failures, system crashes, race conditions, or other potential dangers that many non-database applications are vulnerable to. Durability typically involves writing to disk storage, with a certain amount of redundancy to protect against power failures or software crashes during write operations. (In InnoDB, the doublewrite buffer assists with durability.)

另请参见 原子操作,提交,并发,双写缓存,隔离级别,锁定,回滚,事务。See Also atomic, commit, concurrency, doublewrite buffer, isolation level, locking, rollback, transaction.

自适应刷新adaptive flushing

An algorithm for InnoDB tables that smooths out the I/O overhead introduced by checkpoints. Instead of flushing all modified 预读 from the 缓冲池 to the data files at once, MySQL periodically flushes small sets of modified pages. The adaptive flushing algorithm extends this process by estimating the optimal rate to perform these periodic flushes, based on the rate of flushing and how fast redo information is generated. An algorithm for InnoDB tables that smooths out the I/O overhead introduced by checkpoints. Instead of flushing all modified pages from the buffer pool to the data files at once, MySQL periodically flushes small sets of modified pages. The adaptive flushing algorithm extends this process by estimating the optimal rate to perform these periodic flushes, based on the rate of flushing and how fast redo information is generated.

另请参见 缓冲池,检查点,数据文件,刷新,InnoDB,页面,重做日志。See Also buffer pool, checkpoint, data files, flush, InnoDB, page, redo log.

自适应哈希索引adaptive hash index

对 InnoDB 表的一种优化,可以通过在内存中构建 哈希索引 来加速使用 = 和 IN 运算符的查找。MySQL 监控 InnoDB 表的索引搜索,如果查询可以从哈希索引中受益,它会自动为频繁访问的索引 页 构建哈希索引。从某种意义上说,自适应哈希索引在运行时配置 MySQL 以利用充足的主内存,更接近主内存数据库的架构。此功能由 innodb_adaptive_hash_index 配置选项控制。因为此功能对某些工作负载有益,而对其他负载可能无效,并且哈希索引所使用的内存从 缓冲池 中预留,通常您应在启用和禁用此功能的情况下进行基准测试。 An optimization for InnoDB tables that can speed up lookups using = and IN operators, by constructing a hash index in memory. MySQL monitors index searches for InnoDB tables, and if queries could benefit from a hash index, it builds one automatically for index pages that are frequently accessed. In a sense, the adaptive hash index configures MySQL at runtime to take advantage of ample main memory, coming closer to the architecture of main-memory databases. This feature is controlled by the innodb_adaptive_hash_index configuration option. Because this feature benefits some workloads and not others, and the memory used for the hash index is reserved in the buffer pool, typically you should benchmark with this feature both enabled and disabled.

哈希索引总是基于表上现有的 B 树 索引构建的。MySQL 可以根据针对该索引的查询模式,在 B 树定义的键的任意长度前缀上构建哈希索引。哈希索引可以是部分的;整个 B 树索引不需要缓存在缓冲池中。The hash index is always built based on an existing B-tree index on the table. MySQL can build a hash index on a prefix of any length of the key defined for the B-tree, depending on the pattern of searches against the index. A hash index can be partial; the whole B-tree index does not need to be cached in the buffer pool.

另请参阅 B 树、缓冲池、哈希索引、页、辅助索引。See Also B-tree, buffer pool, hash index, page, secondary index.

ADO.NET

一个用于使用 .NET 技术(如 ASP.NET)构建的应用程序的对象关系映射(ORM)框架。这样的应用程序可以通过 Connector/NET 组件与 MySQL 进行接口对接。 An object-relational mapping (ORM) framework for applications built using .NET technologies such as ASP.NET. Such applications can interface with MySQL through the Connector/NET component.

另请参阅 .NET、ASP.net、Connector/NET、Mono、Visual Studio。See Also .NET, ASP.net, Connector/NET, Mono, Visual Studio.

AIO

异步 I/O 的缩写。您可能会在 InnoDB 消息或关键字中看到此缩写。 Acronym for asynchronous I/O. You might see this acronym in InnoDB messages or keywords.

另请参见 异步 I/O。See Also asynchronous I/O.

ANSI

在 ODBC 中,支持字符集和其他国际化方面的替代方法。与 Unicode 相比。Connector/ODBC 3.51 是 ANSI 驱动程序,而 Connector/ODBC 5.1 是 Unicode 驱动程序。 In ODBC, an alternative method of supporting character sets and other internationalization aspects. Contrast with Unicode. Connector/ODBC 3.51 is an ANSI driver, while Connector/ODBC 5.1 is a Unicode driver.

另请参见 Connector/ODBC,ODBC,Unicode。See Also Connector/ODBC, ODBC, Unicode.

API

API 提供从 客户端 程序对 MySQL 协议和 MySQL 资源的低级访问。与 连接器 提供的高级访问形成对比。 APIs provide low-level access to the MySQL protocol and MySQL resources from client programs. Contrast with the higher-level access provided by a Connector.

另请参见 C API、客户端、连接器、本地 C API、Perl API、PHP API、Python API、Ruby API。See Also C API, client, connector, native C API, Perl API, PHP API, Python API, Ruby API.

应用程序编程接口(API)application programming interface (API)

一组函数或过程。API 提供了一套稳定的名称和类型,用于函数、过程、参数和返回值。 A set of functions or procedures. An API provides a stable set of names and types for functions, procedures, parameters, and return values.

应用apply

当由 MySQL 企业备份 产品生成的备份不包括备份进行期间发生的最新更改时,将备份文件更新以包含这些更改的过程称为 应用 步骤。它由 mysqlbackup 命令的 apply-log 选项指定。 When a backup produced by the MySQL Enterprise Backup product does not include the most recent changes that occurred while the backup was underway, the process of updating the backup files to include those changes is known as the apply step. It is specified by the apply-log option of the mysqlbackup command.

在应用更改之前,我们将这些文件称为 原始备份。在应用更改之后,我们将这些文件称为 已准备备份。这些更改记录在 ibbackup_logfile 文件中;一旦应用步骤完成,该文件就不再需要。Before the changes are applied, we refer to the files as a raw backup. After the changes are applied, we refer to the files as a prepared backup. The changes are recorded in the ibbackup_logfile file; once the apply step is finished, this file is no longer necessary.

另请参见 热备份、ibbackup_logfile、MySQL 企业备份、已准备备份、原始备份。See Also hot backup, ibbackup_logfile, MySQL Enterprise Backup, prepared backup, raw backup.

AS

Kerberos 认证服务器。AS 也可以指认证服务器提供的认证服务。 A Kerberos authentication server. AS can also refer to the authentication service provided by an authentication server.

另请参见 认证服务器。See Also authentication server.

ASP.net

一个使用 .NET 技术和语言开发基于 Web 的应用程序的框架。这类应用程序可以通过 Connector/NET 组件与 MySQL 交互。 A framework for developing web-based applications using .NET technologies and languages. Such applications can interface with MySQL through the Connector/NET component.

另一种用于编写带有 MySQL 的服务器端网页的技术是 PHP。Another technology for writing server-side web pages with MySQL is PHP.

另请参见 .NET、ADO.NET、Connector/NET、Mono、PHP、Visual Studio。See Also .NET, ADO.NET, Connector/NET, Mono, PHP, Visual Studio.

程序集 (assembly)assembly

在 .NET 系统中,通过 Connector/NET 访问的已编译代码库。存储在 GAC 中,以允许版本控制而不会发生命名冲突。 A library of compiled code in a .NET system, accessed through Connector/NET. Stored in the GAC to allow versioning without naming conflicts.

另请参见 .NET、GAC。See Also .NET, GAC.

异步输入/输出asynchronous I/O

一种允许在 I/O 完成之前继续进行其他处理的 I/O 操作类型。也称为 非阻塞 I/O,缩写为 AIO。InnoDB 对某些可以并行运行且不影响数据库可靠性的操作使用这种类型的 I/O,例如将尚未实际请求但可能很快需要的页面读取到 缓冲池 中。 A type of I/O operation that allows other processing to proceed before the I/O is completed. Also known as nonblocking I/O and abbreviated as AIO. InnoDB uses this type of I/O for certain operations that can run in parallel without affecting the reliability of the database, such as reading pages into the buffer pool that have not actually been requested, but might be needed soon.

历史上,InnoDB 仅在 Windows 系统上使用异步 I/O。从 InnoDB 插件 1.1 和 MySQL 5.5 开始,InnoDB 在 Linux 系统上也使用异步 I/O。此更改引入了对 libaio 的依赖。在 Linux 系统上,异步 I/O 通过 innodb_use_native_aio 选项进行配置,该选项默认启用。在其他类似 Unix 的系统上,InnoDB 仅使用同步 I/O。Historically, InnoDB used asynchronous I/O on Windows systems only. Starting with the InnoDB Plugin 1.1 and MySQL 5.5, InnoDB uses asynchronous I/O on Linux systems. This change introduces a dependency on libaio. Asynchronous I/O on Linux systems is configured using the innodb_use_native_aio option, which is enabled by default. On other Unix-like systems, InnoDB uses synchronous I/O only.

另请参阅 缓冲池,非阻塞 I/O。See Also buffer pool, nonblocking I/O.

原子性atomic

在 SQL 环境中,事务 是工作单元,它要么完全成功(当 提交 时),要么完全无效(当 回滚 时)。事务的不可分割(“原子”)特性是缩写 ACID 中的 “A”。 In the SQL context, transactions are units of work that either succeed entirely (when committed) or have no effect at all (when rolled back). The indivisible ("atomic") property of transactions is the “A” in the acronym ACID.

另见 ACID、提交、回滚、事务。See Also ACID, commit, rollback, transaction.

原子 DDLatomic DDL

原子 DDL 语句是将与 DDL 操作相关的 数据字典 更新、存储引擎 操作和 二进制日志 写入组合成单一的、原子的事务。该事务要么完全提交,要么回滚,即使服务器在操作过程中停止。MySQL 8.0 添加了对原子 DDL 的支持。有关更多信息,请参见 第 15.1.1 节,“原子数据定义语句支持”。 An atomic DDL statement is one that combines the data dictionary updates, storage engine operations, and binary log writes associated with a DDL operation into a single, atomic transaction. The transaction is either fully committed or rolled back, even if the server halts during the operation. Atomic DDL support was added in MySQL 8.0. For more information, see Section 15.1.1, “Atomic Data Definition Statement Support”.

另请参见 二进制日志、数据字典、DDL、存储引擎。See Also binary log, data dictionary, DDL, storage engine.

原子指令atomic instruction

CPU 提供的特殊指令,用于确保关键的低级操作不会被中断。 Special instructions provided by the CPU, to ensure that critical low-level operations cannot be interrupted.

认证服务器authentication server

在 Kerberos 中,一种服务提供初始票据,该票据用于获取票据授权票 (TGT),从而可以从票据授权服务器 (TGS) 获取其他票据。认证服务器 (AS) 与 TGS 结合组成密钥分发中心 (KDC)。 In Kerberos, a service that provides the initial ticket needed to obtain a ticket-granting ticket (TGT) that is needed to obtain other tickets from the ticket-granting server (TGS). The authentication server (AS) combined with a TGS make up a key distribution center (KDC).

另请参见 密钥分发中心, 票据授权服务器。See Also key distribution center, ticket-granting server.

自动递增auto-increment

表列的一种属性(由 AUTO_INCREMENT 关键字指定),自动在该列中添加递增的数值序列。 A property of a table column (specified by the AUTO_INCREMENT keyword) that automatically adds an ascending sequence of values in the column.

它为开发者节省了工作量,不必在插入新行时产生新的唯一值。它为查询优化器提供了有用的信息,因为该列已知不为空且具有唯一值。这样的列的值可以在各种情况下用作查找键,并且由于它们是自动生成的,没有理由去更改它们;因此,主键列通常被指定为自增列。It saves work for the developer, not to have to produce new unique values when inserting new rows. It provides useful information for the query optimizer, because the column is known to be not null and with unique values. The values from such a column can be used as lookup keys in various contexts, and because they are auto-generated there is no reason to ever change them; for this reason, primary key columns are often specified as auto-incrementing.

自增列在基于语句的复制中可能会出现问题,因为在副本上重放这些语句可能不会产生与源端相同的一组列值,这主要是由于时间问题。当您有一个自增主键时,只能在设置 innodb_autoinc_lock_mode=1 的情况下使用基于语句的复制。如果您使用 innodb_autoinc_lock_mode=2,它允许插入操作具有更高的并发性,请使用 基于行的复制 而不是 基于语句的复制。设置 innodb_autoinc_lock_mode=0 除了为了兼容性之外,不应该使用。Auto-increment columns can be problematic with statement-based replication, because replaying the statements on a replica might not produce the same set of column values as on the source, due to timing issues. When you have an auto-incrementing primary key, you can use statement-based replication only with the setting innodb_autoinc_lock_mode=1. If you have innodb_autoinc_lock_mode=2, which allows higher concurrency for insert operations, use row-based replication rather than statement-based replication. The setting innodb_autoinc_lock_mode=0 should not be used except for compatibility purposes.

连续锁模式 (innodb_autoinc_lock_mode=1) 是 MySQL 8.0.3 之前的默认设置。从 MySQL 8.0.3 开始,交错锁模式 (innodb_autoinc_lock_mode=2) 成为默认设置,这反映了默认复制类型从基于语句的复制变为基于行的复制的变化。Consecutive lock mode (innodb_autoinc_lock_mode=1) is the default setting prior to MySQL 8.0.3. As of MySQL 8.0.3, interleaved lock mode (innodb_autoinc_lock_mode=2) is the default, which reflects the change from statement-based to row-based replication as the default replication type.

另请参见 自增锁定、innodb_autoinc_lock_mode、主键、基于行的复制、基于语句的复制。See Also auto-increment locking, innodb_autoinc_lock_mode, primary key, row-based replication, statement-based replication.

自增锁定auto-increment locking

自增主键的便利性伴随着一些并发性的权衡。在最简单的情况下,如果一个事务正在向表中插入值,其他事务必须等待才能进行自己的插入操作,以便第一个事务插入的行能够获得连续的主键值。InnoDB 包含优化方法和 innodb_autoinc_lock_mode 选项,允许你在可预测的自增值序列和插入操作的最大并发之间配置最佳平衡。 The convenience of an auto-increment primary key involves some tradeoff with concurrency. In the simplest case, if one transaction is inserting values into the table, any other transactions must wait to do their own inserts into that table, so that rows inserted by the first transaction receive consecutive primary key values. InnoDB includes optimizations and the innodb_autoinc_lock_mode option so that you can configure and optimal balance between predictable sequences of auto-increment values and maximum concurrency for insert operations.

参见 自动递增、并发、innodb_autoinc_lock_mode。See Also auto-increment, concurrency, innodb_autoinc_lock_mode.

自动提交autocommit

这个设置会在每条 SQL 语句后执行一次 提交 操作。对于跨多条语句的 InnoDB 表的 事务,不推荐使用这种模式。它可以提升 InnoDB 表的 只读事务 的性能,因为它最小化了 锁定 和 撤销 数据的生成开销,尤其是在 MySQL 5.6.4 及更高版本中。对于处理 MyISAM 表(事务不适用)也是合适的。 A setting that causes a commit operation after each SQL statement. This mode is not recommended for working with InnoDB tables with transactions that span several statements. It can help performance for read-only transactions on InnoDB tables, where it minimizes overhead from locking and generation of undo data, especially in MySQL 5.6.4 and up. It is also appropriate for working with MyISAM tables, where transactions are not applicable.

另请参见 提交、锁定、只读事务、SQL、事务、撤销。See Also commit, locking, read-only transaction, SQL, transaction, undo.

可用性availability

在主机上处理故障的能力,如果必要,还能从 MySQL、操作系统或硬件的故障及可能导致停机的维护活动中恢复。通常与 可扩展性 配对,作为大规模部署的关键方面。 The ability to cope with, and if necessary recover from, failures on the host, including failures of MySQL, the operating system, or the hardware and maintenance activity that may otherwise cause downtime. Often paired with scalability as critical aspects of a large-scale deployment.

另请参见 可扩展性。See Also scalability.

MySQL 企业备份MySQL Enterprise Backup

一款带许可的产品,可对 MySQL 数据库执行 热备份。在备份 InnoDB 表时,它提供了最高的效率和灵活性,但也可以备份 MyISAM 及其他类型的表。 A licensed product that performs hot backups of MySQL databases. It offers the most efficiency and flexibility when backing up InnoDB tables, but can also back up MyISAM and other kinds of tables.

另请参见 热备份,InnoDB。See Also hot backup, InnoDB.

BB

B 树B-tree

一种在数据库索引中广泛使用的树形数据结构。该结构始终保持排序状态,从而可以快速查找精确匹配(等于运算符)和范围(例如,大于、小于,以及 BETWEEN 运算符)的数据。这种类型的索引在大多数存储引擎中都可用,例如 InnoDB 和 MyISAM。 A tree data structure that is popular for use in database indexes. The structure is kept sorted at all times, enabling fast lookup for exact matches (equals operator) and ranges (for example, greater than, less than, and BETWEEN operators). This type of index is available for most storage engines, such as InnoDB and MyISAM.

由于 B 树节点可以有多个子节点,因此 B 树不同于每个节点仅限 2 个子节点的二叉树。Because B-tree nodes can have many children, a B-tree is not the same as a binary tree, which is limited to 2 children per node.

与 哈希索引 相比,哈希索引仅在 MEMORY 存储引擎中可用。MEMORY 存储引擎也可以使用 B 树索引,如果某些查询使用范围操作符,则应为 MEMORY 表选择 B 树索引。Contrast with hash index, which is only available in the MEMORY storage engine. The MEMORY storage engine can also use B-tree indexes, and you should choose B-tree indexes for MEMORY tables if some queries use range operators.

使用术语 B 树旨在指代一般的索引设计类别。MySQL 存储引擎使用的 B 树结构可以视为由于某些在经典 B 树设计中不存在的复杂性而产生的变体。有关相关信息,请参阅 InnoDB 页面结构 Fil Header 部分的 MySQL 内部手册。The use of the term B-tree is intended as a reference to the general class of index design. B-tree structures used by MySQL storage engines may be regarded as variants due to sophistications not present in a classic B-tree design. For related information, refer to the InnoDB Page Structure Fil Header section of the MySQL Internals Manual.

另请参见 哈希索引。See Also hash index.

反引号backticks

如果标识符包含特殊字符或保留字,则 MySQL SQL 语句中的标识符必须使用反引号字符 (`) 引起来。例如,要引用名为 FOO#BAR 的表或名为 SELECT 的列,你需要将标识符指定为 `FOO#BAR` 和 `SELECT`。由于反引号提供了额外的安全性,它们在程序生成的 SQL 语句中被广泛使用,因为此类标识符名称可能事先未知。 Identifiers within MySQL SQL statements must be quoted using the backtick character (`) if they contain special characters or reserved words. For example, to refer to a table named FOO#BAR or a column named SELECT, you would specify the identifiers as `FOO#BAR` and `SELECT`. Since the backticks provide an extra level of safety, they are used extensively in program-generated SQL statements, where the identifier names might not be known in advance.

许多其他数据库系统在这种特殊名称周围使用双引号 (")。为了可移植性,你可以在 MySQL 中启用 ANSI_QUOTES 模式,并使用双引号代替反引号来限定标识符名称。Many other database systems use double quotation marks (") around such special names. For portability, you can enable ANSI_QUOTES mode in MySQL and use double quotation marks instead of backticks to qualify identifier names.

另请参见 SQL。See Also SQL.

备份backup

从 MySQL 实例中复制部分或全部表数据和元数据以进行保存的过程。也可以指复制文件的集合。这是 DBA 的一项关键任务。此过程的逆操作是 恢复 操作。 The process of copying some or all table data and metadata from a MySQL instance, for safekeeping. Can also refer to the set of copied files. This is a crucial task for DBAs. The reverse of this process is the restore operation.

在 MySQL 中,物理备份 由 MySQL Enterprise Backup 产品执行,而 逻辑备份 由 mysqldump 命令执行。这些技术在备份数据的大小、表示形式以及速度(尤其是恢复操作的速度)方面具有不同的特性。With MySQL, physical backups are performed by the MySQL Enterprise Backup product, and logical backups are performed by the mysqldump command. These techniques have different characteristics in terms of size and representation of the backup data, and speed (especially speed of the restore operation).

备份根据其对正常数据库操作的干扰程度进一步分类为热备份、温备份或冷备份。(热备份干扰最小,冷备份干扰最大。)Backups are further classified as hot, warm, or cold depending on how much they interfere with normal database operation. (Hot backups have the least interference, cold backups the most.)

另请参见 冷备份、热备份、逻辑备份、MySQL 企业备份、mysqldump、物理备份、温备份。See Also cold backup, hot backup, logical backup, MySQL Enterprise Backup, mysqldump, physical backup, warm backup.

基础列base column

一个非生成的表列,用于作为存储生成列或虚拟生成列的基础。换句话说,基础列是生成列定义的一部分的非生成表列。 A non-generated table column upon which a stored generated column or virtual generated column is based. In other words, a base column is a non-generated table column that is part of a generated column definition.

另请参见 生成列,存储生成列,虚拟生成列。See Also generated column, stored generated column, virtual generated column.

测试版beta

软件产品生命周期的早期阶段,此时软件仅可用于评估,通常没有明确的发行版本号或版本号小于 1。InnoDB 不使用 beta 版本标记,而是更倾向于一个可持续数个小版本发布阶段的早期采用者阶段,最终发布为GA版本。 An early stage in the life of a software product, when it is available only for evaluation, typically without a definite release number or a number less than 1. InnoDB does not use the beta designation, preferring an early adopter phase that can extend over several point releases, leading to a GA release.

另请参见 早期采用者、GA。See Also early adopter, GA.

二进制日志binary log

一个包含尝试更改表数据的所有语句或行更改记录的文件。二进制日志的内容可以重放,以便在复制场景中使副本保持最新,或者在从备份恢复表数据后使数据库保持最新。二进制日志功能可以开启或关闭,但如果使用复制或执行备份,Oracle 建议始终启用该功能。 A file containing a record of all statements or row changes that attempt to change table data. The contents of the binary log can be replayed to bring replicas up to date in a replication scenario, or to bring a database up to date after restoring table data from a backup. The binary logging feature can be turned on and off, although Oracle recommends always enabling it if you use replication or perform backups.

您可以使用 mysqlbinlog 命令来检查二进制日志的内容,或在复制或恢复期间重放它。有关二进制日志的完整信息,请参见 第 7.4.4 节,“二进制日志”。有关 MySQL 配置选项与二进制日志相关的信息,请参见 第 19.1.6.4 节,“二进制日志选项和变量”。You can examine the contents of the binary log, or replay it during replication or recovery, by using the mysqlbinlog command. For full information about the binary log, see Section 7.4.4, “The Binary Log”. For MySQL configuration options related to the binary log, see Section 19.1.6.4, “Binary Logging Options and Variables”.

对于 MySQL 企业备份 产品,二进制日志的文件名以及文件中的当前位置是重要的详细信息。在复制环境中进行备份时,为记录源的信息,可以指定 --slave-info 选项。For the MySQL Enterprise Backup product, the file name of the binary log and the current position within the file are important details. To record this information for the source when taking a backup in a replication context, you can specify the --slave-info option.

在 MySQL 5.0 之前,类似的功能被称为更新日志。在 MySQL 5.0 及更高版本中,二进制日志取代了更新日志。Prior to MySQL 5.0, a similar capability was available, known as the update log. In MySQL 5.0 and higher, the binary log replaces the update log.

另请参阅 binlog、MySQL 企业备份、复制。See Also binlog, MySQL Enterprise Backup, replication.

二进制日志binlog

二进制日志 文件的非正式名称。例如,你可能会在电子邮件或论坛讨论中看到这个缩写的使用。 An informal name for the binary log file. For example, you might see this abbreviation used in e-mail messages or forum discussions.

另请参见 二进制日志。See Also binary log.

盲查询扩展blind query expansion

由 WITH QUERY EXPANSION 子句启用的一种特殊模式的 全文搜索。它执行两次搜索,其中第二次搜索的搜索短语是由第一次搜索中最相关的几份文档与原始搜索短语组合而成的。该技术主要适用于短搜索短语,可能只是一个单词。它可以发现那些文档中未出现精确搜索词的相关匹配项。 A special mode of full-text search enabled by the WITH QUERY EXPANSION clause. It performs the search twice, where the search phrase for the second search is the original search phrase concatenated with the few most highly relevant documents from the first search. This technique is mainly applicable for short search phrases, perhaps only a single word. It can uncover relevant matches where the precise search term does not occur in the document.

另请参见 全文搜索。See Also full-text search.

BLOB

SQL 数据类型(TINYBLOB、BLOB、MEDIUMBLOB 和 LONGBLOB)用于包含任意大小的二进制数据的对象。用于存储文档、图像、音频文件以及其他无法轻易分解为 MySQL 表中行和列的信息。在 MySQL 应用程序中处理 BLOB 的技术因各个 连接器 和 API 而异。MySQL Connector/ODBC 将 BLOB 值定义为 LONGVARBINARY。对于大规模、自由格式的字符数据集合,业界术语是 CLOB,在 MySQL 中由 TEXT 数据类型表示。 An SQL data type (TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB) for objects containing any kind of binary data, of arbitrary size. Used for storing documents, images, sound files, and other kinds of information that cannot easily be decomposed to rows and columns within a MySQL table. The techniques for handling BLOBs within a MySQL application vary with each Connector and API. MySQL Connector/ODBC defines BLOB values as LONGVARBINARY. For large, free-form collections of character data, the industry term is CLOB, represented by the MySQL TEXT data types.

另请参阅 API,CLOB,连接器,Connector/ODBC。See Also API, CLOB, connector, Connector/ODBC.

瓶颈bottleneck

系统中受大小或容量限制的一部分,其效果是限制整体吞吐量。例如,内存区域可能比所需的小;访问单个必需资源可能会阻止多个 CPU 核心同时运行;或者等待磁盘 I/O 完成可能会阻止 CPU 以全容量运行。消除瓶颈往往能提高 并发性。例如,拥有多个 InnoDB 缓冲池 实例可以在多个会话同时从缓冲池读取和写入时减少争用。 A portion of a system that is constrained in size or capacity, that has the effect of limiting overall throughput. For example, a memory area might be smaller than necessary; access to a single required resource might prevent multiple CPU cores from running simultaneously; or waiting for disk I/O to complete might prevent the CPU from running at full capacity. Removing bottlenecks tends to improve concurrency. For example, the ability to have multiple InnoDB buffer pool instances reduces contention when multiple sessions read from and write to the buffer pool simultaneously.

另请参见 缓冲池,并发性。See Also buffer pool, concurrency.

重启bounce

一次 关闭 操作紧接着立即进行重启。理想情况下,预热 时间相对较短,以便性能和吞吐量能够快速恢复到较高水平。 A shutdown operation immediately followed by a restart. Ideally with a relatively short warmup period so that performance and throughput quickly return to a high level.

另请参见 关闭。See Also shutdown.

伙伴分配器buddy allocator

用于管理 InnoDB 缓冲池 中不同大小 页 的机制。 A mechanism for managing different-sized pages in the InnoDB buffer pool.

另请参见 缓冲池、页、页大小。See Also buffer pool, page, page size.

缓冲区buffer

用于临时存储的内存或磁盘区域。数据会缓存在内存中,以便通过少量的大型 I/O 操作而非大量小型操作高效地写入磁盘。数据也会缓存在磁盘上以提高可靠性,这样即使在最糟糕的时间发生 崩溃 或其他故障时,也能够恢复。InnoDB 使用的主要缓冲类型是 缓冲池、双写缓冲 和 更改缓冲。 A memory or disk area used for temporary storage. Data is buffered in memory so that it can be written to disk efficiently, with a few large I/O operations rather than many small ones. Data is buffered on disk for greater reliability, so that it can be recovered even when a crash or other failure occurs at the worst possible time. The main types of buffers used by InnoDB are the buffer pool, the doublewrite buffer, and the change buffer.

另请参见 缓冲池、更改缓冲区、崩溃、双写缓冲区。See Also buffer pool, change buffer, crash, doublewrite buffer.

缓冲池buffer pool

存储缓存 InnoDB 数据(包括表和索引)的内存区域。为了高吞吐量读操作的效率,缓冲池被划分为可以容纳多行的 页。为了缓存管理的效率,缓冲池实现为页的链表;很少使用的数据会使用一种 LRU 算法的变体从缓存中逐出。在内存较大的系统中,你可以通过将缓冲池划分为多个 缓冲池实例 来提高并发性。 The memory area that holds cached InnoDB data for both tables and indexes. For efficiency of high-volume read operations, the buffer pool is divided into pages that can potentially hold multiple rows. For efficiency of cache management, the buffer pool is implemented as a linked list of pages; data that is rarely used is aged out of the cache, using a variation of the LRU algorithm. On systems with large memory, you can improve concurrency by dividing the buffer pool into multiple buffer pool instances.

一些 InnoDB 状态变量、INFORMATION_SCHEMA 表和 performance_schema 表有助于监控缓冲池的内部运作。从 MySQL 5.6 开始,您可以通过在服务器关闭时保存缓冲池状态,并在服务器启动时将缓冲池恢复到相同状态,来避免服务器重启后的长时间预热,尤其适用于具有大缓冲池的实例。请参阅 第 17.8.3.6 节,“保存和恢复缓冲池状态”。Several InnoDB status variables, INFORMATION_SCHEMA tables, and performance_schema tables help to monitor the internal workings of the buffer pool. Starting in MySQL 5.6, you can avoid a lengthy warmup period after restarting the server, particularly for instances with large buffer pools, by saving the buffer pool state at server shutdown and restoring the buffer pool to the same state at server startup. See Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”.

另请参见 缓冲池实例,LRU,页,预热。See Also buffer pool instance, LRU, page, warm up.

缓冲池实例buffer pool instance

缓冲池 可以被划分为的多个区域中的任意一个,由 innodb_buffer_pool_instances 配置选项控制。innodb_buffer_pool_size 指定的总内存大小将在所有缓冲池实例中进行分配。通常,对于向 InnoDB 缓冲池分配多个 GB 的系统,多个缓冲池实例是合适的,每个实例大小为 1GB 或更大。在从许多并发会话加载或查找缓冲池中大量数据的系统上,多个缓冲池实例可以减少对管理缓冲池的数据结构的独占访问的争用。 Any of the multiple regions into which the buffer pool can be divided, controlled by the innodb_buffer_pool_instances configuration option. The total memory size specified by innodb_buffer_pool_size is divided among all buffer pool instances. Typically, having multiple buffer pool instances is appropriate for systems that allocate multiple gigabytes to the InnoDB buffer pool, with each instance being one gigabyte or larger. On systems loading or looking up large amounts of data in the buffer pool from many concurrent sessions, having multiple buffer pool instances reduces contention for exclusive access to data structures that manage the buffer pool.

另见 缓冲池。See Also buffer pool.

内置built-in

MySQL 中的内置 InnoDB 存储引擎是该存储引擎的原始发行形式。与 InnoDB 插件 相对。自 MySQL 5.5 起,InnoDB 插件重新合并回 MySQL 代码库作为内置 InnoDB 存储引擎(称为 InnoDB 1.1)。 The built-in InnoDB storage engine within MySQL is the original form of distribution for the storage engine. Contrast with the InnoDB Plugin. Starting with MySQL 5.5, the InnoDB Plugin is merged back into the MySQL code base as the built-in InnoDB storage engine (known as InnoDB 1.1).

这个区别主要在 MySQL 5.1 中很重要,因为某个特性或错误修复可能适用于 InnoDB 插件,但不适用于内置 InnoDB,反之亦然。This distinction is important mainly in MySQL 5.1, where a feature or bug fix might apply to the InnoDB Plugin but not the built-in InnoDB, or vice versa.

另见 InnoDB。See Also InnoDB.

业务规则business rules

构成业务软件基础的关系和操作序列,用于运营商业公司。有时这些规则由法律规定,有时则由公司政策决定。通过仔细的规划,可以确保数据库中编码和执行的关系,以及通过应用逻辑执行的操作,准确反映公司的真实政策,并能够应对现实中的情况。 The relationships and sequences of actions that form the basis of business software, used to run a commercial company. Sometimes these rules are dictated by law, other times by company policy. Careful planning ensures that the relationships encoded and enforced by the database, and the actions performed through application logic, accurately reflect the real policies of the company and can handle real-life situations.

例如,员工离开公司可能会触发人力资源部门的一系列操作。人力资源数据库可能还需要具有灵活性,以表示已经被聘用但尚未开始工作的人员信息。关闭在线服务账户可能会导致数据库中的数据被删除,或者数据可能被移动或标记,以便在账户重新开启时可以恢复。一家公司可能会制定关于工资最高限额、最低限额和调整的政策,除此之外还会有基本的合理性检查,例如工资不能为负数。零售数据库可能不允许同一序列号的商品被退货超过一次,或者不允许超过某个数额的信用卡购买,而用于检测欺诈的数据库可能允许这些情况。For example, an employee leaving a company might trigger a sequence of actions from the human resources department. The human resources database might also need the flexibility to represent data about a person who has been hired, but not yet started work. Closing an account at an online service might result in data being removed from a database, or the data might be moved or flagged so that it could be recovered if the account is re-opened. A company might establish policies regarding salary maximums, minimums, and adjustments, in addition to basic sanity checks such as the salary not being a negative number. A retail database might not allow a purchase with the same serial number to be returned more than once, or might not allow credit card purchases above a certain value, while a database used to detect fraud might allow these kinds of things.

另请参见 关系型。See Also relational.

CC

.cfg 文件.cfg file

与 InnoDB 可迁移表空间 功能一起使用的元数据文件。它由命令 FLUSH TABLES ... FOR EXPORT 生成,将一个或多个表置于一致状态,从而可以复制到另一台服务器。.cfg 文件会与对应的 .ibd 文件 一起复制,并在 ALTER TABLE ... IMPORT TABLESPACE 步骤中用于调整 .ibd 文件的内部值,例如 空间 ID。 A metadata file used with the InnoDB transportable tablespace feature. It is produced by the command FLUSH TABLES ... FOR EXPORT, puts one or more tables in a consistent state that can be copied to another server. The .cfg file is copied along with the corresponding .ibd file, and used to adjust the internal values of the .ibd file, such as the space ID, during the ALTER TABLE ... IMPORT TABLESPACE step.

另请参见 .ibd 文件,空间 ID,可传输表空间。See Also .ibd file, space ID, transportable tablespace.

C

一种结合了可移植性、性能以及对低级硬件功能访问的编程语言,使其成为编写操作系统、驱动程序和其他类型系统软件的流行选择。许多复杂的应用程序、语言和可重用模块包含用 C 编写的部分,并与用其他语言编写的高级组件结合在一起。其核心语法对 C 、Java 和 C# 开发者来说很熟悉。 A programming language that combines portability with performance and access to low-level hardware features, making it a popular choice for writing operating systems, drivers, and other kinds of system software. Many complex applications, languages, and reusable modules feature pieces written in C, tied together with high-level components written in other languages. Its core syntax is familiar to C++, Java, and C# developers.

另请参见 C API,C,C#,Java。See Also C API, C++, C#, Java.

C API

C API 代码随 MySQL 一起分发。它包含在 libmysqlclient 库中,使 C 程序能够访问数据库。 The C API code is distributed with MySQL. It is included in the libmysqlclient library and enables C programs to access a database.

另请参见 API,C,libmysqlclient。See Also API, C, libmysqlclient.

C#

一种结合了强类型和面向对象特性的编程语言,在 Microsoft .NET 框架或其开源版本 Mono 上运行。通常用于使用 ASP.net 框架创建应用程序。其语法对于 C、C++ 和 Java 开发者来说很熟悉。 A programming language combining strong typing and object-oriented features, running within the Microsoft .NET framework or its open-source counterpart Mono. Often used for creating applications with the ASP.net framework. Its syntax is familiar to C, C++ and Java developers.

另请参见 .NET、ASP.net、C、Connector/NET、C++、Java、Mono。See Also .NET, ASP.net, C, Connector/NET, C++, Java, Mono.

C++

一种其核心语法对 C 开发者来说非常熟悉的编程语言。提供对低级操作的访问以提升性能,同时结合了更高级的数据类型、面向对象特性和垃圾回收。若要为 MySQL 编写 C 应用程序,您需要使用 Connector/C 组件。 A programming language with core syntax familiar to C developers. Provides access to low-level operations for performance, combined with higher-level data types, object-oriented features, and garbage collection. To write C++ applications for MySQL, you use the Connector/C++ component.

另见 C,Connector/C 。See Also C, Connector/C++.

缓存cache

泛指用于存储数据副本以便频繁或高速检索的任何内存区域。在 InnoDB 中,主要的缓存结构类型是 缓冲池。 The general term for any memory area that stores copies of data for frequent or high-speed retrieval. In InnoDB, the primary kind of cache structure is the buffer pool.

另请参见 缓冲区,缓冲池。See Also buffer, buffer pool.

基数cardinality

表中某个 列 中不同值的数量。当查询引用具有关联 索引 的列时,每列的基数会影响哪种访问方法最有效。例如,对于具有 唯一约束 的列,不同值的数量等于表中的行数。如果一个表有一百万行,但某一列只有 10 个不同的值,每个值平均出现 100,000 次。像 SELECT c1 FROM t1 WHERE c1 = 50; 这样的查询可能返回 1 行或大量行,并且数据库服务器可能会根据 c1 的基数以不同的方式处理查询。 The number of different values in a table column. When queries refer to columns that have an associated index, the cardinality of each column influences which access method is most efficient. For example, for a column with a unique constraint, the number of different values is equal to the number of rows in the table. If a table has a million rows but only 10 different values for a particular column, each value occurs (on average) 100,000 times. A query such as SELECT c1 FROM t1 WHERE c1 = 50; thus might return 1 row or a huge number of rows, and the database server might process the query differently depending on the cardinality of c1.

如果一列中的值分布非常不均匀,基数可能不是确定最佳查询计划的好方法。例如,SELECT c1 FROM t1 WHERE c1 = x; 当 x=50 时可能返回 1 行,而当 x=30 时可能返回一百万行。在这种情况下,你可能需要使用 索引提示 来提供关于哪种查找方法对特定查询更有效的建议。If the values in a column have a very uneven distribution, the cardinality might not be a good way to determine the best query plan. For example, SELECT c1 FROM t1 WHERE c1 = x; might return 1 row when x=50 and a million rows when x=30. In such a case, you might need to use index hints to pass along advice about which lookup method is more efficient for a particular query.

基数也可以应用于多列中存在的不同值的数量,例如在 复合索引 中。Cardinality can also apply to the number of distinct values present in multiple columns, as in a composite index.

另请参见 列,复合索引,索引,索引提示,持久统计,随机深入,选择性,唯一约束。See Also column, composite index, index, index hint, persistent statistics, random dive, selectivity, unique constraint.

更改缓冲change buffer

一种特殊的数据结构,用于记录在二级索引中的页面所发生的更改。这些值可能来源于 SQL INSERT、UPDATE或DELETE 语句(DML)。涉及更改缓冲区的一系列特性统称为更改缓冲,包括插入缓冲、删除缓冲和清理缓冲。 A special data structure that records changes to pages in secondary indexes. These values could result from SQL INSERT, UPDATE, or DELETE statements (DML). The set of features involving the change buffer is known collectively as change buffering, consisting of insert buffering, delete buffering, and purge buffering.

当来自二级索引的相关页面不在缓冲池中时,变更才会记录在变更缓冲区中。当相关的索引页面在关联的变更仍在变更缓冲区中时被加载到缓冲池中,该页面的变更会在缓冲池中应用(合并),使用变更缓冲区中的数据。系统大部分时间空闲或在缓慢关机期间运行的清理操作会定期将新的索引页面写入磁盘。与每个值立即写入磁盘相比,清理操作可以更高效地写入一系列索引值对应的磁盘块。Changes are only recorded in the change buffer when the relevant page from the secondary index is not in the buffer pool. When the relevant index page is brought into the buffer pool while associated changes are still in the change buffer, the changes for that page are applied in the buffer pool (merged) using the data from the change buffer. Periodically, the purge operation that runs during times when the system is mostly idle, or during a slow shutdown, writes the new index pages to disk. The purge operation can write the disk blocks for a series of index values more efficiently than if each value were written to disk immediately.

在物理上,变更缓冲区是系统表空间的一部分,因此索引更改在数据库重启后仍然保持缓冲状态。只有当页面由于某些其他读取操作被加载到缓冲池时,这些更改才会被应用(合并)。Physically, the change buffer is part of the system tablespace, so that the index changes remain buffered across database restarts. The changes are only applied (merged) when the pages are brought into the buffer pool due to some other read operation.

存储在变更缓冲区中的数据类型和数量由innodb_change_buffering和innodb_change_buffer_max_size配置选项控制。要查看变更缓冲区中当前数据的信息,请执行SHOW ENGINE INNODB STATUS命令。The kinds and amount of data stored in the change buffer are governed by the innodb_change_buffering and innodb_change_buffer_max_size configuration options. To see information about the current data in the change buffer, issue the SHOW ENGINE INNODB STATUS command.

以前被称为 插入缓冲区。Formerly known as the insert buffer.

另请参见 缓冲池,更改缓冲,删除缓冲,DML,插入缓冲,插入缓冲处理,合并,页,清除,清除缓冲处理,二级索引,系统表空间。See Also buffer pool, change buffering, delete buffering, DML, insert buffer, insert buffering, merge, page, purge, purge buffering, secondary index, system tablespace.

更改缓冲change buffering

涉及 更改缓冲区 的功能的一般术语,包括 插入缓冲、删除缓冲 和 清除缓冲。由 SQL 语句引起的索引更改,通常可能涉及随机 I/O 操作,会被暂时保留,并由后台 线程 定期执行。这一操作序列能够比每个值立即写入磁盘更高效地写入一系列索引值的磁盘块。由 innodb_change_buffering 和 innodb_change_buffer_max_size 配置选项控制。 The general term for the features involving the change buffer, consisting of insert buffering, delete buffering, and purge buffering. Index changes resulting from SQL statements, which could normally involve random I/O operations, are held back and performed periodically by a background thread. This sequence of operations can write the disk blocks for a series of index values more efficiently than if each value were written to disk immediately. Controlled by the innodb_change_buffering and innodb_change_buffer_max_size configuration options.

另请参见 更改缓冲区、删除缓冲、插入缓冲、清除缓冲。See Also change buffer, delete buffering, insert buffering, purge buffering.

检查点checkpoint

当对缓存于 缓冲池 中的数据页进行修改时,这些修改会在稍后写入 数据文件,这一过程称为 刷新。检查点是已成功写入数据文件的最新修改记录(以 LSN 值表示)。 As changes are made to data pages that are cached in the buffer pool, those changes are written to the data files sometime later, a process known as flushing. The checkpoint is a record of the latest changes (represented by an LSN value) that have been successfully written to the data files.

参见 缓冲池、数据文件、刷新、模糊检查点、LSN。See Also buffer pool, data files, flush, fuzzy checkpointing, LSN.

校验和checksum

在 InnoDB 中,当 表空间 中的 页 从磁盘读取到 InnoDB 缓冲池 时,有一种用于检测损坏的验证机制。此功能由 MySQL 5.5 中的 innodb_checksums 配置选项控制。innodb_checksums 在 MySQL 5.6.3 中已被弃用,并由 innodb_checksum_algorithm 替代。 In InnoDB, a validation mechanism to detect corruption when a page in a tablespace is read from disk into the InnoDB buffer pool. This feature is controlled by the innodb_checksums configuration option in MySQL 5.5. innodb_checksums is deprecated in MySQL 5.6.3, replaced by innodb_checksum_algorithm.

innochecksum 命令通过在 MySQL 服务器关闭时测试指定 表空间 文件的校验和值,帮助诊断损坏问题。The innochecksum command helps diagnose corruption problems by testing the checksum values for a specified tablespace file while the MySQL server is shut down.

MySQL 也使用校验和进行复制。有关详细信息,请参见配置选项 binlog_checksum、source_verify_checksum 或 master_verify_checksum,以及 replica_sql_verify_checksum 或 slave_sql_verify_checksum。MySQL also uses checksums for replication purposes. For details, see the configuration options binlog_checksum, source_verify_checksum or master_verify_checksum, and replica_sql_verify_checksum or slave_sql_verify_checksum.

另请参见 缓冲池、页、表空间。See Also buffer pool, page, tablespace.

子表child table

在 外键 关系中,子表是指其行引用(或指向)另一张表中在特定列上具有相同值的行。这是包含 FOREIGN KEY ... REFERENCES 子句的表,并可选择性地包含 ON UPDATE 和 ON DELETE 子句。在子表中创建行之前,相应的 父表 行必须存在。子表中的值可以阻止对父表的删除或更新操作,或者根据创建外键时使用的 ON CASCADE 选项,在子表中自动执行删除或更新操作。 In a foreign key relationship, a child table is one whose rows refer (or point) to rows in another table with an identical value for a specific column. This is the table that contains the FOREIGN KEY ... REFERENCES clause and optionally ON UPDATE and ON DELETE clauses. The corresponding row in the parent table must exist before the row can be created in the child table. The values in the child table can prevent delete or update operations on the parent table, or can cause automatic deletion or updates in the child table, based on the ON CASCADE option used when creating the foreign key.

另见 外键,父表。See Also foreign key, parent table.

干净页clean page

页 位于 InnoDB 缓冲池 中,其中所有在内存中进行的更改也已写入(刷新)到 数据文件。与 脏页 相对。 A page in the InnoDB buffer pool where all changes made in memory have also been written (flushed) to the data files. The opposite of a dirty page.

另请参见 缓冲池、数据文件、脏页、刷新、页面。See Also buffer pool, data files, dirty page, flush, page.

干净关闭clean shutdown

一个在完成前不出错并将所有更改应用到 InnoDB 表的 关闭,与 崩溃 或 快速关闭 相对。是 慢速关闭 的同义词。 A shutdown that completes without errors and applies all changes to InnoDB tables before finishing, as opposed to a crash or a fast shutdown. Synonym for slow shutdown.

另请参阅 崩溃,快速关闭,关闭,慢速关闭。See Also crash, fast shutdown, shutdown, slow shutdown.

客户端client

一个在数据库服务器外运行的程序,通过发送请求到 连接器 或通过 客户端库 提供的 API 与数据库通信。它可以在与数据库服务器相同的物理机器上运行,也可以在通过网络连接的远程机器上运行。它可以是专用数据库应用程序,也可以是像 mysql 命令行处理器这样的通用程序。 A program that runs outside the database server, communicating with the database by sending requests through a Connector, or an API made available through client libraries. It can run on the same physical machine as the database server, or on a remote machine connected over a network. It can be a special-purpose database application, or a general-purpose program like the mysql command-line processor.

另请参见 API,客户端库,连接器,MySQL,服务器。See Also API, client libraries, connector, mysql, server.

客户端库client libraries

包含用于数据库操作的函数集合的文件。通过使用这些库编译程序,或在与应用程序相同的系统上安装它们,您可以在没有安装 MySQL 服务器的机器上运行数据库应用程序(称为 客户端);应用程序通过网络访问数据库。使用 MySQL 时,您可以使用 MySQL 服务器本身提供的 libmysqlclient 库。 Files containing collections of functions for working with databases. By compiling your program with these libraries, or installing them on the same system as your application, you can run a database application (known as a client) on a machine that does not have the MySQL server installed; the application accesses the database over a network. With MySQL, you can use the libmysqlclient library from the MySQL server itself.

另请参阅 客户端、libmysqlclient。See Also client, libmysqlclient.

客户端预处理语句client-side prepared statement

一种 预准备语句 类型,其中缓存和重用由本地管理,模拟 服务器端预准备语句 的功能。历史上,一些 Connector/J、Connector/ODBC 和 Connector/PHP 开发人员用它来解决服务器端存储过程的问题。在现代 MySQL 服务器版本中,出于性能、可扩展性和内存效率的考虑,推荐使用服务器端预准备语句。 A type of prepared statement where the caching and reuse are managed locally, emulating the functionality of server-side prepared statements. Historically, used by some Connector/J, Connector/ODBC, and Connector/PHP developers to work around issues with server-side stored procedures. With modern MySQL server versions, server-side prepared statements are recommended for performance, scalability, and memory efficiency.

另请参见 Connector/J, Connector/ODBC, Connector/PHP, 预处理语句。See Also Connector/J, Connector/ODBC, Connector/PHP, prepared statement.

CLOB

一种 SQL 数据类型(TINYTEXT、TEXT、MEDIUMTEXT 或 LONGTEXT),用于包含任意大小的任意字符数据的对象。用于存储基于文本的文档,并具有相关的字符集和排序规则。在 MySQL 应用程序中处理 CLOB 的技术根据每个 Connector 和 API 而有所不同。MySQL Connector/ODBC 将 TEXT 值定义为 LONGVARCHAR。用于存储二进制数据的等效类型是 BLOB 类型。 An SQL data type (TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT) for objects containing any kind of character data, of arbitrary size. Used for storing text-based documents, with associated character set and collation order. The techniques for handling CLOBs within a MySQL application vary with each Connector and API. MySQL Connector/ODBC defines TEXT values as LONGVARCHAR. For storing binary data, the equivalent is the BLOB type.

另请参见 API、BLOB、连接器、Connector/ODBC。See Also API, BLOB, connector, Connector/ODBC.

聚集索引clustered index

InnoDB 对 主键 索引的术语。InnoDB 表存储是基于主键列的值进行组织的,以加快涉及主键列的查询和排序。为了获得最佳性能,应根据最关键性能的查询仔细选择主键列。由于修改聚集索引的列是一个开销大的操作,因此应选择很少或从不更新的主键列。 The InnoDB term for a primary key index. InnoDB table storage is organized based on the values of the primary key columns, to speed up queries and sorts involving the primary key columns. For best performance, choose the primary key columns carefully based on the most performance-critical queries. Because modifying the columns of the clustered index is an expensive operation, choose primary columns that are rarely or never updated.

在 Oracle 数据库产品中,这种类型的表被称为 索引组织表。In the Oracle Database product, this type of table is known as an index-organized table.

另请参阅 索引, 主键, 二级索引。See Also index, primary key, secondary index.

冷备份cold backup

在数据库关闭时进行的备份。对于繁忙的应用程序和网站,这可能不切实际,您可能更倾向于温备份或热备份。 A backup taken while the database is shut down. For busy applications and websites, this might not be practical, and you might prefer a warm backup or a hot backup.

另见 备份,热备份,温备份。See Also backup, hot backup, warm backup.

列column

A data item within a row, whose storage and semantics are defined by a data type. Each table以及索引 is largely defined by the set of columns it contains. A data item within a row, whose storage and semantics are defined by a data type. Each table and index is largely defined by the set of columns it contains.

Each column has a 基数 value. A column can be the primary key for its table, or part of the primary key. A column can be subject to a unique constraint, a NOT NULL constraint, or both. Values in different columns, even across different tables, can be linked by a foreign key relationship.Each column has a cardinality value. A column can be the primary key for its table, or part of the primary key. A column can be subject to a unique constraint, a NOT NULL constraint, or both. Values in different columns, even across different tables, can be linked by a foreign key relationship.

在讨论 MySQL 内部操作时,有时 字段 被用作同义词。In discussions of MySQL internal operations, sometimes field is used as a synonym.

另请参阅 基数、外键、索引、非空约束、主键、行、表、唯一约束。See Also cardinality, foreign key, index, NOT NULL constraint, primary key, row, table, unique constraint.

列索引column index

单列上的一个索引。 An index on a single column.

另请参见 复合索引, 索引。See Also composite index, index.

列前缀column prefix

当创建 索引 并指定长度时,例如 CREATE INDEX idx ON t1 (c1(N)),索引中只存储列值的前 N 个字符。保持索引前缀较小可以使索引更紧凑,节省内存和磁盘 I/O 从而提高性能。(尽管将索引前缀设得过小可能会影响查询优化,使查询优化器认为值不同的行是重复的行。) When an index is created with a length specification, such as CREATE INDEX idx ON t1 (c1(N)), only the first N characters of the column value are stored in the index. Keeping the index prefix small makes the index compact, and the memory and disk I/O savings help performance. (Although making the index prefix too small can hinder query optimization by making rows with different values appear to the query optimizer to be duplicates.)

对于包含二进制值或长文本字符串的列,如果排序不是主要考虑因素且在索引中存储整个值会浪费空间,则索引会自动使用值的前 N 个字符(通常为 768 个字符)进行查找和排序。For columns containing binary values or long text strings, where sorting is not a major consideration and storing the entire value in the index would waste space, the index automatically uses the first N (typically 768) characters of the value to do lookups and sorts.

参见 索引。See Also index.

命令拦截器command interceptor

语句拦截器 的同义词。拦截器设计模式的一个方面,可用于 Connector/NET 和 Connector/J。Connector/NET 中称为命令的,在 Connector/J 中称为语句。与 异常拦截器 相对。 Synonym for statement interceptor. One aspect of the interceptor design pattern available for both Connector/NET and Connector/J. What Connector/NET calls a command, Connector/J refers to as a statement. Contrast with exception interceptor.

另见 Connector/J,Connector/NET,异常拦截器,拦截器,语句拦截器。See Also Connector/J, Connector/NET, exception interceptor, interceptor, statement interceptor.

提交commit

一条 SQL 语句,用于结束一项 事务,使事务所做的任何更改永久生效。它与 回滚 相反,后者会撤销事务中所做的任何更改。 A SQL statement that ends a transaction, making permanent any changes made by the transaction. It is the opposite of rollback, which undoes any changes made in the transaction.

InnoDB 使用一种 乐观 的提交机制,因此更改可以在提交实际发生之前写入数据文件。这种技术使提交本身更快,但代价是如果回滚,则需要更多工作。InnoDB uses an optimistic mechanism for commits, so that changes can be written to the data files before the commit actually occurs. This technique makes the commit itself faster, with the tradeoff that more work is required in case of a rollback.

默认情况下,MySQL 使用 自动提交 设置,它会在每条 SQL 语句之后自动发出提交。By default, MySQL uses the autocommit setting, which automatically issues a commit following each SQL statement.

另请参见 自动提交、乐观、回滚、SQL、事务。See Also autocommit, optimistic, rollback, SQL, transaction.

紧凑行格式compact row format

InnoDB 表的行格式。它是从 MySQL 5.0.3 到 MySQL 5.7.8 的默认行格式。在 MySQL 8.0 中,默认行格式由 innodb_default_row_format 配置选项定义,默认设置为 DYNAMIC。COMPACT 行格式相比 REDUNDANT 行格式,为空值和可变长度列提供了更紧凑的表示。 A row format for InnoDB tables. It was the default row format from MySQL 5.0.3 to MySQL 5.7.8. In MySQL 8.0, the default row format is defined by the innodb_default_row_format configuration option, which has a default setting of DYNAMIC. The COMPACT row format provides a more compact representation for nulls and variable-length columns than the REDUNDANT row format.

有关 InnoDB COMPACT 行格式的更多信息,请参见 第 17.10 节,“InnoDB 行格式”。For additional information about InnoDB COMPACT row format, see Section 17.10, “InnoDB Row Formats”.

另请参见 动态行格式、文件格式、冗余行格式、行格式。See Also dynamic row format, file format, redundant row format, row format.

组合索引composite index

一个包含多个列的索引。 An index that includes multiple columns.

参见 索引。See Also index.

压缩备份compressed backup

MySQL 企业备份 产品的压缩功能会为每个表空间创建压缩副本,并将扩展名从 .ibd 更改为 .ibz。压缩备份数据可以让您保留更多的备份,并减少将备份传输到其他服务器所需的时间。在恢复操作期间,数据会被解压缩。当压缩备份操作处理已经压缩的表时,它会跳过该表的压缩步骤,因为再次压缩几乎不会节省空间。 The compression feature of the MySQL Enterprise Backup product makes a compressed copy of each tablespace, changing the extension from .ibd to .ibz. Compressing backup data allows you to keep more backups on hand, and reduces the time to transfer backups to a different server. The data is uncompressed during the restore operation. When a compressed backup operation processes a table that is already compressed, it skips the compression step for that table, because compressing again would result in little or no space savings.

由 MySQL 企业备份 产品生成的一组文件,其中每个 表空间 都已压缩。压缩后的文件将重命名为 .ibz 文件扩展名。A set of files produced by the MySQL Enterprise Backup product, where each tablespace is compressed. The compressed files are renamed with a .ibz file extension.

在备份过程开始时应用压缩有助于在压缩过程中避免存储开销,并在将备份文件传输到另一台服务器时避免网络开销。应用二进制日志的过程需要更长时间,并且需要解压备份文件。Applying compression at the start of the backup process helps to avoid storage overhead during the compression process, and to avoid network overhead when transferring the backup files to another server. The process of applying the binary log takes longer, and requires uncompressing the backup files.

另请参阅 应用, 二进制日志, 压缩, 热备份, MySQL 企业备份, 表空间。See Also apply, binary log, compression, hot backup, MySQL Enterprise Backup, tablespace.

压缩行格式compressed row format

一种 行格式,可以对 InnoDB 表的数据和索引进行 压缩。大型字段会存储在与保存其余行数据的页面分开的地方,就像 动态行格式 一样。索引页和大型字段都会被压缩,从而节省内存和磁盘空间。根据数据结构的不同,内存和磁盘使用量的减少可能会抵消或不抵消解压数据时的性能开销。有关使用细节,请参见 第 17.9 节,“InnoDB 表和页面压缩”。 A row format that enables data and index compression for InnoDB tables. Large fields are stored away from the page that holds the rest of the row data, as in dynamic row format. Both index pages and the large fields are compressed, yielding memory and disk savings. Depending on the structure of the data, the decrease in memory and disk usage might or might not outweigh the performance overhead of uncompressing the data as it is used. See Section 17.9, “InnoDB Table and Page Compression” for usage details.

有关 InnoDB COMPRESSED 行格式的更多信息,请参见 DYNAMIC 行格式。For additional information about InnoDB COMPRESSED row format, see DYNAMIC Row Format.

另请参见 压缩、动态行格式、行格式。See Also compression, dynamic row format, row format.

压缩表compressed table

数据以压缩形式存储的表。对于 InnoDB,这是通过 ROW_FORMAT=COMPRESSED 创建的表。有关更多信息,请参见 第 17.9 节,“InnoDB 表和页压缩”。 A table for which the data is stored in compressed form. For InnoDB, it is a table created with ROW_FORMAT=COMPRESSED. See Section 17.9, “InnoDB Table and Page Compression” for more information.

另请参见 压缩行格式、压缩。See Also compressed row format, compression.

压缩compression

一种功能,可带来广泛的好处,包括使用更少的磁盘空间、执行更少的 I/O 以及缓存使用更少的内存。 A feature with wide-ranging benefits from using less disk space, performing less I/O, and using less memory for caching.

InnoDB 支持表级和页级压缩。InnoDB 页压缩也称为 透明页压缩。有关 InnoDB 压缩的更多信息,请参见 第 17.9 节,“InnoDB 表和页压缩”。InnoDB supports both table-level and page-level compression. InnoDB page compression is also referred to as transparent page compression. For more information about InnoDB compression, see Section 17.9, “InnoDB Table and Page Compression”.

另一种类型的压缩是 MySQL Enterprise Backup 产品中的 压缩备份 功能。Another type of compression is the compressed backup feature of the MySQL Enterprise Backup product.

另请参见 缓冲池,压缩备份,压缩行格式,DML,透明页压缩。See Also buffer pool, compressed backup, compressed row format, DML, transparent page compression.

压缩失败compression failure

这实际上不是一个错误,而是在使用 压缩 与 DML 操作结合时可能发生的昂贵操作。它发生在:对压缩的 页面 的更新超出了页面上用于记录修改的区域;页面再次压缩,并将所有更改应用到表数据;重新压缩的数据无法适应原始页面,需要 MySQL 将数据拆分到两个新页面并分别压缩。要检查此情况的发生频率,请查询 INFORMATION_SCHEMA.INNODB_CMP 表,并检查 COMPRESS_OPS 列的值超过 COMPRESS_OPS_OK 列的值多少。理想情况下,压缩失败不应频繁发生;当发生时,可以调整 innodb_compression_level、innodb_compression_failure_threshold_pct 和 innodb_compression_pad_pct_max 配置选项。 Not actually an error, rather an expensive operation that can occur when using compression in combination with DML operations. It occurs when: updates to a compressed page overflow the area on the page reserved for recording modifications; the page is compressed again, with all changes applied to the table data; the re-compressed data does not fit on the original page, requiring MySQL to split the data into two new pages and compress each one separately. To check the frequency of this condition, query the INFORMATION_SCHEMA.INNODB_CMP table and check how much the value of the COMPRESS_OPS column exceeds the value of the COMPRESS_OPS_OK column. Ideally, compression failures do not occur often; when they do, you can adjust the innodb_compression_level, innodb_compression_failure_threshold_pct, and innodb_compression_pad_pct_max configuration options.

另请参见 压缩,DML,页面。See Also compression, DML, page.

串联索引concatenated index

参见 组合索引。See composite index.

并发concurrency

多个操作(在数据库术语中,事务)同时运行而互不干扰的能力。并发还涉及性能,因为理想情况下,多重同时事务的保护应使用最低的性能开销,采用高效的锁定机制。 The ability of multiple operations (in database terminology, transactions) to run simultaneously, without interfering with each other. Concurrency is also involved with performance, because ideally the protection for multiple simultaneous transactions works with a minimum of performance overhead, using efficient mechanisms for locking.

另请参见 ACID,锁定,事务。See Also ACID, locking, transaction.

配置文件configuration file

该文件保存 MySQL 启动时使用的 选项 值。传统上,在 Linux 和 Unix 系统上该文件名为 my.cnf,在 Windows 系统上则为 my.ini。你可以在文件的 [mysqld] 部分设置与 InnoDB 相关的多个选项。 The file that holds the option values used by MySQL at startup. Traditionally, on Linux and Unix this file is named my.cnf, and on Windows it is named my.ini. You can set a number of options related to InnoDB under the [mysqld] section of the file.

有关 MySQL 搜索配置文件位置的信息,请参见 第 6.2.2.2 节,“使用选项文件”。See Section 6.2.2.2, “Using Option Files” for information about where MySQL searches for configuration files.

当您使用MySQL 企业备份产品时,通常会使用两个配置文件:一个指定数据来源及其结构(这可能是服务器的原始配置文件),另一个是精简版,仅包含少量选项,指定备份数据的去向及其结构。与MySQL 企业备份产品一起使用的配置文件必须包含某些通常会被常规配置文件省略的选项,因此您可能需要在现有配置文件中添加选项以用于MySQL 企业备份。When you use the MySQL Enterprise Backup product, you typically use two configuration files: one that specifies where the data comes from and how it is structured (which could be the original configuration file for your server), and a stripped-down one containing only a small set of options that specify where the backup data goes and how it is structured. The configuration files used with the MySQL Enterprise Backup product must contain certain options that are typically left out of regular configuration files, so you might need to add options to your existing configuration file for use with MySQL Enterprise Backup.

另请参见 my.cnf,MySQL 企业备份,选项,选项文件。See Also my.cnf, MySQL Enterprise Backup, option, option file.

连接connection

应用程序与 MySQL 服务器之间的通信通道。数据库应用程序的性能和可扩展性受数据库连接建立速度、可同时建立的连接数量以及连接持续时间的影响。在 Connector/NET 中,这些参数如 host、port 等被表示为 connection string,而在 Connector/ODBC 中则表示为 DSN。高流量系统使用一种称为 connection pool 的优化技术。 The communication channel between an application and a MySQL server. The performance and scalability of a database applications is influenced by on how quickly a database connection can be established, how many can be made simultaneously, and how long they persist. The parameters such as host, port, and so on are represented as a connection string in Connector/NET, and as a DSN in Connector/ODBC. High-traffic systems make use of an optimization known as the connection pool.

另请参见 连接池,连接字符串,Connector/NET,Connector/ODBC,DSN,主机,端口。See Also connection pool, connection string, Connector/NET, Connector/ODBC, DSN, host, port.

连接池connection pool

一个缓存区域,允许数据库连接在同一应用程序内或跨不同应用程序重用,而不是为每个数据库操作建立和拆除新的连接。这种技术在J2EE应用服务器中很常见。使用Connector/J的Java应用程序可以使用Tomcat和其他应用服务器的连接池功能。重用对应用程序是透明的;应用程序仍然像往常一样打开和关闭连接。 A cache area that allows database connections to be reused within the same application or across different applications, rather than setting up and tearing down a new connection for every database operation. This technique is common with J2EE application servers. Java applications using Connector/J can use the connection pool features of Tomcat and other application servers. The reuse is transparent to applications; the application still opens and closes the connection as usual.

另请参阅 连接,Connector/J,J2EE,Tomcat。See Also connection, Connector/J, J2EE, Tomcat.

连接字符串connection string

数据库连接参数的表示形式,被编码为字符串字面量,以便在程序代码中使用。字符串的各个部分表示连接参数,例如主机和端口。连接字符串包含多个键值对,用分号分隔。每个键值对用等号连接。常用于Connector/NET应用程序;详情请参见创建 Connector/NET 连接字符串。 A representation of the parameters for a database connection, encoded as a string literal so that it can be used in program code. The parts of the string represent connection parameters such as host and port. A connection string contains several key-value pairs, separated by semicolons. Each key-value pair is joined with an equal sign. Frequently used with Connector/NET applications; see Creating a Connector/NET Connection String for details.

另见 连接,Connector/NET,主机,端口。See Also connection, Connector/NET, host, port.

连接器connector

MySQL 连接器为 客户端 程序提供与 MySQL 服务器的连接。多种编程语言和框架各自都有其关联的连接器。与由 API 提供的低级访问形成对比。 MySQL Connectors provide connectivity to the MySQL server for client programs. Several programming languages and frameworks each have their own associated Connector. Contrast with the lower-level access provided by an API.

另请参阅 API,客户端,Connector/C ,Connector/J,Connector/NET,Connector/ODBC。See Also API, client, Connector/C++, Connector/J, Connector/NET, Connector/ODBC.

连接器/CConnector/C++

Connector/C 8.0 可用于访问实现了文档存储的 MySQL 服务器,或者以传统方式使用 SQL 查询。它支持使用 X DevAPI 开发 C 应用程序,或者使用 C 的 X DevAPI 开发普通 C 应用程序。它还支持开发使用 Connector/C 1.1 的遗留基于 JDBC 的 API 的 C 应用程序。更多信息请参见 MySQL Connector/C 9.5 开发者指南。 Connector/C++ 8.0 can be used to access MySQL servers that implement a document store, or in a traditional way using SQL queries. It enables development of C++ applications using X DevAPI, or plain C applications using X DevAPI for C. It also enables development of C++ applications that use the legacy JDBC-based API from Connector/C++ 1.1. For more information, see MySQL Connector/C++ 9.5 Developer Guide.

另请参阅 客户端、连接器、JDBC。See Also client, connector, JDBC.

Connector/J

一个 JDBC 驱动程序,为使用 Java 编程语言开发的 客户端 应用程序提供连接。MySQL Connector/J 是一个 JDBC 类型 4 驱动程序:它是 MySQL 协议的纯 Java 实现,无需依赖 MySQL 客户端库。有关详细信息,请参见 MySQL Connector/J 开发者指南。 A JDBC driver that provides connectivity for client applications developed in the Java programming language. MySQL Connector/J is a JDBC Type 4 driver: a pure-Java implementation of the MySQL protocol that does not rely on the MySQL client libraries. For full details, see MySQL Connector/J Developer Guide.

另请参见 客户端、客户端库、连接器、Java、JDBC。See Also client, client libraries, connector, Java, JDBC.

Connector/NET

一个 MySQL 连接器,用于开发者使用 C#、.NET、Mono、Visual Studio、ASP.net 和 ADO.net 等语言、技术和框架编写应用程序。 A MySQL connector for developers writing applications using languages, technologies, and frameworks such as C#, .NET, Mono, Visual Studio, ASP.net, and ADO.net.

另请参见 ADO.NET,ASP.net,连接器,C#,Mono,Visual Studio。See Also ADO.NET, ASP.net, connector, C#, Mono, Visual Studio.

Connector/ODBC

这是一系列 MySQL ODBC 驱动程序,提供使用行业标准开放数据库连接(ODBC)API 访问 MySQL 数据库的功能。以前称为 MyODBC 驱动程序。有关完整详细信息,请参见 MySQL Connector/ODBC 开发者指南。 The family of MySQL ODBC drivers that provide access to a MySQL database using the industry standard Open Database Connectivity (ODBC) API. Formerly called MyODBC drivers. For full details, see MySQL Connector/ODBC Developer Guide.

另请参见 连接器、ODBC。See Also connector, ODBC.

Connector/PHP

针对 PHP 的 mysql 和 mysqli API 版本,针对 Windows 操作系统进行了优化。 A version of the mysql and mysqli APIs for PHP optimized for the Windows operating system.

另请参见 连接器、PHP、PHP API。See Also connector, PHP, PHP API.

一致性读取consistent read

一种读取操作,使用快照信息根据某个时间点呈现查询结果,而不管同时运行的其他事务所执行的更改。如果查询的数据已被其他事务更改,原始数据将根据回滚日志的内容重建。这种技术避免了一些锁定问题,这些问题可能通过强制事务等待其他事务完成而降低并发性。 A read operation that uses snapshot information to present query results based on a point in time, regardless of changes performed by other transactions running at the same time. If queried data has been changed by another transaction, the original data is reconstructed based on the contents of the undo log. This technique avoids some of the locking issues that can reduce concurrency by forcing transactions to wait for other transactions to finish.

With 可重复读 isolation level, the snapshot is based on the time when the first read operation is performed. With 已提交读 isolation level, the snapshot is reset to the time of each consistent read operation.With REPEATABLE READ isolation level, the snapshot is based on the time when the first read operation is performed. With READ COMMITTED isolation level, the snapshot is reset to the time of each consistent read operation.

一致性读取是InnoDB在已提交读和可重复读隔离级别中处理SELECT语句的默认模式。由于一致性读取不会对其访问的表设置任何锁,因此在执行一致性读取的同时,其他会话可以自由修改这些表。Consistent read is the default mode in which InnoDB processes SELECT statements in READ COMMITTED and REPEATABLE READ isolation levels. Because a consistent read does not set any locks on the tables it accesses, other sessions are free to modify those tables while a consistent read is being performed on the table.

有关适用隔离级别的技术细节,请参阅 第 17.7.2.3 节,“一致的非锁定读取”。For technical details about the applicable isolation levels, see Section 17.7.2.3, “Consistent Nonlocking Reads”.

另请参见 并发,隔离级别,锁定,已提交读,可重复读,快照,事务,回滚日志。See Also concurrency, isolation level, locking, READ COMMITTED, REPEATABLE READ, snapshot, transaction, undo log.

约束constraint

一种自动测试,可以阻止数据库更改,以防数据变得不一致。(在计算机科学术语中,是与不变量条件相关的一种断言。)约束是 ACID 理念的重要组成部分,用于维护数据一致性。MySQL 支持的约束包括 外键约束 和 唯一约束。 An automatic test that can block database changes to prevent data from becoming inconsistent. (In computer science terms, a kind of assertion related to an invariant condition.) Constraints are a crucial component of the ACID philosophy, to maintain data consistency. Constraints supported by MySQL include FOREIGN KEY constraints and unique constraints.

另请参阅 ACID、外键、唯一约束。See Also ACID, foreign key, unique constraint.

计数器counter

一个通过特定类型的 InnoDB 操作递增的值。用于衡量服务器的繁忙程度、排查性能问题的来源,以及测试更改(例如,配置设置或查询使用的索引)是否具有预期的低级效果。通过 Performance Schema 表和 INFORMATION_SCHEMA 表可以获取不同类型的计数器,特别是 INFORMATION_SCHEMA.INNODB_METRICS。 A value that is incremented by a particular kind of InnoDB operation. Useful for measuring how busy a server is, troubleshooting the sources of performance issues, and testing whether changes (for example, to configuration settings or indexes used by queries) have the desired low-level effects. Different kinds of counters are available through Performance Schema tables and INFORMATION_SCHEMA tables, particularly INFORMATION_SCHEMA.INNODB_METRICS.

另请参见 INFORMATION_SCHEMA,指标计数器,Performance Schema。See Also INFORMATION_SCHEMA, metrics counter, Performance Schema.

覆盖索引covering index

一个索引,包含查询所检索的所有列。查询可以直接从索引结构返回值,而不是使用索引值作为指针去查找完整的表行,这样可以节省磁盘 I/O。InnoDB 可以将这种优化技术应用于比 MyISAM 更多的索引,因为InnoDB的辅助索引也包含主键列。对于事务修改过的表上的查询,InnoDB 不能应用这种技术,直到该事务结束。 An index that includes all the columns retrieved by a query. Instead of using the index values as pointers to find the full table rows, the query returns values from the index structure, saving disk I/O. InnoDB can apply this optimization technique to more indexes than MyISAM can, because InnoDB secondary indexes also include the primary key columns. InnoDB cannot apply this technique for queries against tables modified by a transaction, until that transaction ends.

任何 列索引 或 复合索引 在合适的查询条件下都可以作为覆盖索引。尽可能设计你的索引和查询以利用这一优化技术。Any column index or composite index could act as a covering index, given the right query. Design your indexes and queries to take advantage of this optimization technique wherever possible.

另请参见 列索引、复合索引、索引、主键、二级索引。See Also column index, composite index, index, primary key, secondary index.

CPU 受限CPU-bound

一种 工作负载 类型,其主要 瓶颈 是内存中的 CPU 操作。通常涉及读密集型操作,其结果都可以缓存在 缓冲池 中。 A type of workload where the primary bottleneck is CPU operations in memory. Typically involves read-intensive operations where the results can all be cached in the buffer pool.

另请参阅 瓶颈,缓冲池,工作负载。See Also bottleneck, buffer pool, workload.

崩溃crash

MySQL 使用术语“崩溃”来一般指任何意外的关机操作,在这种情况下服务器无法进行正常的清理。例如,崩溃可能由于数据库服务器或存储设备的硬件故障、断电、可能导致 MySQL 服务器停止的潜在数据不匹配、DBA 发起的快速关闭,或许多其他原因发生。对InnoDB表的强大自动崩溃恢复确保在服务器重启时数据保持一致,DBA 无需额外操作。 MySQL uses the term “crash” to refer generally to any unexpected shutdown operation where the server cannot do its normal cleanup. For example, a crash could happen due to a hardware fault on the database server machine or storage device; a power failure; a potential data mismatch that causes the MySQL server to halt; a fast shutdown initiated by the DBA; or many other reasons. The robust, automatic crash recovery for InnoDB tables ensures that data is made consistent when the server is restarted, without any extra work for the DBA.

参见 崩溃恢复,快速关闭,InnoDB,关闭。See Also crash recovery, fast shutdown, InnoDB, shutdown.

崩溃恢复crash recovery

当 MySQL 在 崩溃 后再次启动时进行的清理活动。对于 InnoDB 表,使用 重做日志 中的数据回放未完成事务的更改。在崩溃前已经 提交 但尚未写入 数据文件 的更改,可以从 双写缓冲区 中重建。当数据库正常关闭时,这类活动会在关闭期间通过 清理 操作进行。 The cleanup activities that occur when MySQL is started again after a crash. For InnoDB tables, changes from incomplete transactions are replayed using data from the redo log. Changes that were committed before the crash, but not yet written into the data files, are reconstructed from the doublewrite buffer. When the database is shut down normally, this type of activity is performed during shutdown by the purge operation.

在正常操作期间,已提交的数据可以暂时存储在变更缓冲区中,然后再写入数据文件。保持数据文件最新会在正常操作期间引入性能开销,而缓冲数据则可能导致关闭和崩溃恢复所需时间更长,这两者之间总是存在权衡。During normal operation, committed data can be stored in the change buffer for a period of time before being written to the data files. There is always a tradeoff between keeping the data files up-to-date, which introduces performance overhead during normal operation, and buffering the data, which can make shutdown and crash recovery take longer.

另见 更改缓冲区、提交、崩溃、数据文件、双写缓冲区、InnoDB、清除、重做日志。See Also change buffer, commit, crash, data files, doublewrite buffer, InnoDB, purge, redo log.

CRUD

Acronym for “create, read, update, delete”, a common sequence of operations in database applications. Often denotes a class of applications with relatively simple database usage (basic DDL, DML以及query statements in SQL) that can be implemented quickly in any language. Acronym for “create, read, update, delete”, a common sequence of operations in database applications. Often denotes a class of applications with relatively simple database usage (basic DDL, DML and query statements in SQL) that can be implemented quickly in any language.

另请参见 DDL、DML、查询、SQL。See Also DDL, DML, query, SQL.

游标cursor

一个内部 MySQL 数据结构,表示 SQL 语句的结果集。通常与 预处理语句 和 动态 SQL 一起使用。它的工作方式类似于其他高级语言中的迭代器,可以按需从结果集中生成每个值。 An internal MySQL data structure that represents the result set of an SQL statement. Often used with prepared statements and dynamic SQL. It works like an iterator in other high-level languages, producing each value from the result set as requested.

尽管 SQL 通常会为你处理游标,但在处理性能关键的代码时,你可能会深入了解其内部工作原理。Although SQL usually handles the processing of cursors for you, you might delve into the inner workings when dealing with performance-critical code.

另请参见 动态 SQL,预处理语句,查询。See Also dynamic SQL, prepared statement, query.

DD

数据定义语言data definition language

参见 DDL。See DDL.

数据字典data dictionary

追踪数据库对象(如 表、索引 以及表 列)的元数据。对于 MySQL 8.0 引入的 MySQL 数据字典,元数据物理存储在 InnoDB 每表文件 表空间文件中,位于 mysql 数据库目录中。对于 InnoDB 数据字典,元数据物理存储在 InnoDB 系统表空间 中。 Metadata that keeps track of database objects such as tables, indexes, and table columns. For the MySQL data dictionary, introduced in MySQL 8.0, metadata is physically located in InnoDB file-per-table tablespace files in the mysql database directory. For the InnoDB data dictionary, metadata is physically located in the InnoDB system tablespace.

因为 MySQL 企业备份 产品始终备份 InnoDB 系统表空间,所以所有备份都包括 InnoDB 数据字典的内容。Because the MySQL Enterprise Backup product always backs up the InnoDB system tablespace, all backups include the contents of the InnoDB data dictionary.

另请参阅 列、每表文件、.frm 文件、索引、MySQL 企业备份、系统表空间、表。See Also column, file-per-table, .frm file, index, MySQL Enterprise Backup, system tablespace, table.

数据目录data directory

每个 MySQL 实例 存放 InnoDB 的 数据文件 及表示各个数据库的目录的目录。由 datadir 配置选项控制。 The directory under which each MySQL instance keeps the data files for InnoDB and the directories representing individual databases. Controlled by the datadir configuration option.

另请参见 数据文件, 实例。See Also data files, instance.

数据文件data files

物理包含 表 和 索引 数据的文件。 The files that physically contain table and index data.

InnoDB 系统表空间,它保存InnoDB 数据字典,并能够保存多个InnoDB表的数据,由一个或多个.ibdata数据文件表示。The InnoDB system tablespace, which holds the InnoDB data dictionary and is capable of holding data for multiple InnoDB tables, is represented by one or more .ibdata data files.

每表独立表空间,保存单个InnoDB表的数据,由一个.ibd数据文件表示。File-per-table tablespaces, which hold data for a single InnoDB table, are represented by a .ibd data file.

通用表空间(在 MySQL 5.7.6 中引入),可以保存多个InnoDB表的数据,也由一个.ibd数据文件表示。General tablespaces (introduced in MySQL 5.7.6), which can hold data for multiple InnoDB tables, are also represented by a .ibd data file.

另见 数据字典, 每表文件, 通用表空间, .ibd 文件, ibdata 文件, 索引, 系统表空间, 表, 表空间。See Also data dictionary, file-per-table, general tablespace, .ibd file, ibdata file, index, system tablespace, table, tablespace.

数据操作语言data manipulation language

参见 DML。See DML.

数据仓库data warehouse

一个主要运行大型查询的数据库系统或应用程序。只读或大部分只读的数据可能以非规范化的形式组织以提高查询效率。可以受益于 MySQL 5.6 及更高版本中针对只读事务的优化。与OLTP形成对比。 A database system or application that primarily runs large queries. The read-only or read-mostly data might be organized in denormalized form for query efficiency. Can benefit from the optimizations for read-only transactions in MySQL 5.6 and higher. Contrast with OLTP.

另请参见 非规范化、OLTP、查询、只读事务。See Also denormalized, OLTP, query, read-only transaction.

数据库database

在 MySQL 的 数据目录 中,每个数据库由一个单独的目录表示。InnoDB 系统表空间 可以存储来自 MySQL 实例 中多个数据库的表数据,它保存在位于各个数据库目录之外的 数据文件 中。当启用 每表文件 模式时,表示单个 InnoDB 表的 .ibd 文件 会存储在数据库目录内,除非使用 DATA DIRECTORY 子句在其他位置创建。MySQL 5.7.6 引入的一般表空间也会在 .ibd 文件 中存储表数据。与每表文件的 .ibd 文件 不同,一般表空间的 .ibd 文件 可以存储来自 MySQL 实例 中多个数据库的表数据,并且可以分配到相对于 MySQL 数据目录的目录或独立于 MySQL 数据目录的目录。 Within the MySQL data directory, each database is represented by a separate directory. The InnoDB system tablespace, which can hold table data from multiple databases within a MySQL instance, is kept in data files that reside outside of individual database directories. When file-per-table mode is enabled, the .ibd files representing individual InnoDB tables are stored inside the database directories unless created elsewhere using the DATA DIRECTORY clause. General tablespaces, introduced in MySQL 5.7.6, also hold table data in .ibd files. Unlike file-per-table .ibd files, general tablespace .ibd files can hold table data from multiple databases within a MySQL instance, and can be assigned to directories relative to or independent of the MySQL data directory.

对于长期使用 MySQL 的用户来说,数据库是一个熟悉的概念。来自 Oracle Database 背景的用户可能会发现,MySQL 中数据库的含义更接近 Oracle Database 所称的 模式。For long-time MySQL users, a database is a familiar notion. Users coming from an Oracle Database background may find that the MySQL meaning of a database is closer to what Oracle Database calls a schema.

另请参见 数据文件、每表文件、.ibd 文件、实例、模式、系统表空间。See Also data files, file-per-table, .ibd file, instance, schema, system tablespace.

DCL

数据控制语言,一组用于管理权限的 SQL 语句。在 MySQL 中,包括 GRANT 和 REVOKE 语句。与 DDL 和 DML 相对。 Data control language, a set of SQL statements for managing privileges. In MySQL, consists of the GRANT and REVOKE statements. Contrast with DDL and DML.

另请参见 DDL、DML、SQL。See Also DDL, DML, SQL.

DDEX 提供者DDEX provider

一个功能,允许你在 Visual Studio 中使用数据设计工具来操作 MySQL 数据库中的架构和对象。对于使用 Connector/NET 的 MySQL 应用程序,MySQL Visual Studio 插件作为 MySQL 5.0 及更高版本的 DDEX 提供程序。 A feature that lets you use the data design tools within Visual Studio to manipulate the schema and objects within a MySQL database. For MySQL applications using Connector/NET, the MySQL Visual Studio Plugin acts as a DDEX provider with MySQL 5.0 and later.

另请参见 Visual Studio。See Also Visual Studio.

DDL

数据定义语言,一组用于操作数据库本身而非单个表行的 SQL 语句。包括所有形式的 CREATE、ALTER 和 DROP 语句。还包括 TRUNCATE 语句,因为它的工作方式与 DELETE FROM table_name 语句不同,尽管最终效果相似。 Data definition language, a set of SQL statements for manipulating the database itself rather than individual table rows. Includes all forms of the CREATE, ALTER, and DROP statements. Also includes the TRUNCATE statement, because it works differently than a DELETE FROM table_name statement, even though the ultimate effect is similar.

DDL 语句会自动 提交 当前的 事务;它们不能被 回滚。DDL statements automatically commit the current transaction; they cannot be rolled back.

InnoDB 的 在线 DDL 功能提升了 CREATE INDEX、DROP INDEX 和多种类型的 ALTER TABLE 操作的性能。有关更多信息,请参见 第 17.12 节,“InnoDB 与在线 DDL”。此外,InnoDB 的 每表文件 设置可能影响 DROP TABLE 和 TRUNCATE TABLE 操作的行为。The InnoDB online DDL feature enhances performance for CREATE INDEX, DROP INDEX, and many types of ALTER TABLE operations. See Section 17.12, “InnoDB and Online DDL” for more information. Also, the InnoDB file-per-table setting can affect the behavior of DROP TABLE and TRUNCATE TABLE operations.

与 DML 和 DCL 对比。Contrast with DML and DCL.

另见 提交、DCL、DML、每表文件、回滚、SQL、事务。See Also commit, DCL, DML, file-per-table, rollback, SQL, transaction.

死锁deadlock

一种情况,不同的事务无法继续执行,因为每个事务都持有另一个事务所需的锁。由于两个事务都在等待资源变得可用,因此没有一个事务会释放它所持有的锁。 A situation where different transactions are unable to proceed, because each holds a lock that the other needs. Because both transactions are waiting for a resource to become available, neither one ever releases the locks it holds.

当事务以相反的顺序在多个表中锁定行(通过UPDATE或SELECT ... FOR UPDATE等语句)时,可能会发生死锁。当此类语句锁定索引记录范围和空隙时,也可能发生死锁,每个事务由于时序问题获取了某些锁但未获取其他锁。A deadlock can occur when the transactions lock rows in multiple tables (through statements such as UPDATE or SELECT ... FOR UPDATE), but in the opposite order. A deadlock can also occur when such statements lock ranges of index records and gaps, with each transaction acquiring some locks but not others due to a timing issue.

有关死锁如何被自动检测和处理的背景信息,请参见 第 17.7.5.2 节,“死锁检测”。有关避免和恢复死锁情况的技巧,请参见 第 17.7.5.3 节,“如何最小化和处理死锁”。For background information on how deadlocks are automatically detected and handled, see Section 17.7.5.2, “Deadlock Detection”. For tips on avoiding and recovering from deadlock conditions, see Section 17.7.5.3, “How to Minimize and Handle Deadlocks”.

另请参见 间隙,锁,事务。See Also gap, lock, transaction.

死锁检测deadlock detection

一种机制,可以自动检测何时发生 死锁,并自动 回滚 其中一个涉及的 事务(即 受害者)。可以使用 innodb_deadlock_detect 配置选项禁用死锁检测。 A mechanism that automatically detects when a deadlock occurs, and automatically rolls back one of the transactions involved (the victim). Deadlock detection can be disabled using the innodb_deadlock_detect configuration option.

另请参阅 死锁、回滚、事务、受害者。See Also deadlock, rollback, transaction, victim.

删除delete

当 InnoDB 处理 DELETE 语句时,行会立即被标记为删除,并且查询将不再返回这些行。存储空间会在稍后通过定期垃圾回收操作,即 清理(purge) 操作中回收。对于删除大量数据,相关操作及其性能特性包括 TRUNCATE 和 DROP。 When InnoDB processes a DELETE statement, the rows are immediately marked for deletion and no longer are returned by queries. The storage is reclaimed sometime later, during the periodic garbage collection known as the purge operation. For removing large quantities of data, related operations with their own performance characteristics are TRUNCATE and DROP.

另请参见 drop、purge、truncate。See Also drop, purge, truncate.

删除缓冲(delete buffering)delete buffering

将由于 DELETE 操作而产生的二级索引页更改存储在 更改缓冲区 中,而不是立即写入的技术,以便物理写入可以以最小化随机 I/O 的方式执行。(因为删除操作是一个两步骤的过程,此操作缓冲通常用于标记索引记录删除的写入。)它是 更改缓冲 的一种类型;其他类型包括 插入缓冲 和 清除缓冲。 The technique of storing changes to secondary index pages, resulting from DELETE operations, in the change buffer rather than writing the changes immediately, so that the physical writes can be performed to minimize random I/O. (Because delete operations are a two-step process, this operation buffers the write that normally marks an index record for deletion.) It is one of the types of change buffering; the others are insert buffering and purge buffering.

另请参见 更改缓冲区、更改缓冲、插入缓冲区、插入缓冲、清除缓冲。See Also change buffer, change buffering, insert buffer, insert buffering, purge buffering.

非规范化denormalized

一种数据存储策略,通过在不同表之间复制数据,而不是使用 外键 和 连接 查询来关联表。通常用于 数据仓库 应用程序,其中数据在加载后不会更新。在此类应用中,查询性能比在更新期间维持数据一致性更为重要。与 规范化 相对。 A data storage strategy that duplicates data across different tables, rather than linking the tables with foreign keys and join queries. Typically used in data warehouse applications, where the data is not updated after loading. In such applications, query performance is more important than making it simple to maintain consistent data during updates. Contrast with normalized.

另请参见 数据仓库,外键,连接,规范化。See Also data warehouse, foreign key, join, normalized.

降序索引descending index

一种索引类型,其中索引存储经过优化以处理ORDER BY column DESC子句。 A type of index where index storage is optimized to process ORDER BY column DESC clauses.

参见 索引。See Also index.

字典对象缓存dictionary object cache

字典对象缓存将之前访问过的数据字典对象存储在内存中,以便重用对象并最小化磁盘 I/O。使用基于LRU的淘汰策略将最少使用的对象从内存中移除。该缓存由多个分区组成,每个分区存储不同类型的对象。 The dictionary object cache stores previously accessed data dictionary objects in memory to enable object reuse and minimize disk I/O. An LRU-based eviction strategy is used to evict least recently used objects from memory. The cache is comprised of several partitions that store different object types.

欲了解更多信息,请参见 第 16.4 节,“字典对象缓存”。For more information, see Section 16.4, “Dictionary Object Cache”.

另请参见 数据字典,LRU。See Also data dictionary, LRU.

脏页dirty page

InnoDB 缓冲池 中已在内存中更新的 页,其更改尚未写入(刷新)到 数据文件。与 干净页 相对。 A page in the InnoDB buffer pool that has been updated in memory, where the changes are not yet written (flushed) to the data files. The opposite of a clean page.

另请参见 缓冲池,干净页,数据文件,刷新,页。See Also buffer pool, clean page, data files, flush, page.

脏读dirty read

一种操作,它检索不可靠的数据,即由其他事务更新但尚未 提交 的数据。仅在称为 读未提交 的 隔离级别 下才可能发生。 An operation that retrieves unreliable data, data that was updated by another transaction but not yet committed. It is only possible with the isolation level known as read uncommitted.

这种操作不遵循数据库设计的ACID原则。它被认为是非常有风险的,因为数据可能会被回滚,或者在提交之前进一步更新;然后,执行脏读的事务将会使用从未确认过准确性的数据。This kind of operation does not adhere to the ACID principle of database design. It is considered very risky, because the data could be rolled back, or updated further before being committed; then, the transaction doing the dirty read would be using data that was never confirmed as accurate.

它的相反是一致性读取,在这种情况下,InnoDB确保事务不会读取被其他事务更新的信息,即使其他事务在此期间提交了。Its opposite is consistent read, where InnoDB ensures that a transaction does not read information updated by another transaction, even if the other transaction commits in the meantime.

另请参见 ACID、提交、一致性读取、隔离级别、未提交读取、回滚。See Also ACID, commit, consistent read, isolation level, READ UNCOMMITTED, rollback.

基于磁盘disk-based

一种主要在磁盘存储(硬盘或同类设备)上组织数据的数据库。数据在磁盘和内存之间来回传输以进行操作。这与 内存数据库 相反。虽然 InnoDB 是基于磁盘的,但它也包含诸如 缓冲池、多个缓冲池实例以及 自适应哈希索引 等功能,使某些类型的工作负载可以主要从内存中运行。 A kind of database that primarily organizes data on disk storage (hard drives or equivalent). Data is brought back and forth between disk and memory to be operated upon. It is the opposite of an in-memory database. Although InnoDB is disk-based, it also contains features such as he buffer pool, multiple buffer pool instances, and the adaptive hash index that allow certain kinds of workloads to work primarily from memory.

另请参见 自适应哈希索引、缓冲池、内存数据库。See Also adaptive hash index, buffer pool, in-memory database.

磁盘受限disk-bound

一种工作负载类型,其主要瓶颈在于磁盘 I/O。(也称为I/O 受限。)通常涉及频繁写入磁盘,或随机读取的数据量大于缓冲池的容量。 A type of workload where the primary bottleneck is disk I/O. (Also known as I/O-bound.) Typically involves frequent writes to disk, or random reads of more data than can fit into the buffer pool.

另请参阅 瓶颈,缓冲池,工作负载。See Also bottleneck, buffer pool, workload.

DML

数据操作语言,一组用于执行 INSERT、UPDATE 和 DELETE 操作的 SQL 语句。SELECT 语句有时也被认为是 DML 语句,因为 SELECT ... FOR UPDATE 形式在 锁定 方面需要考虑与 INSERT、UPDATE 和 DELETE 相同的因素。 Data manipulation language, a set of SQL statements for performing INSERT, UPDATE, and DELETE operations. The SELECT statement is sometimes considered as a DML statement, because the SELECT ... FOR UPDATE form is subject to the same considerations for locking as INSERT, UPDATE, and DELETE.

针对 InnoDB 表的 DML 语句是在 事务 的上下文中操作的,因此其效果可以作为一个单元 提交 或 回滚。DML statements for an InnoDB table operate in the context of a transaction, so their effects can be committed or rolled back as a single unit.

与 DDL 和 DCL 形成对比。Contrast with DDL and DCL.

参见 提交、DCL、DDL、锁定、回滚、SQL、事务。See Also commit, DCL, DDL, locking, rollback, SQL, transaction.

文档 IDdocument id

在 InnoDB 全文搜索 功能中,表中包含 FULLTEXT 索引 的特殊列,用于唯一标识与每个 ilist 值关联的文档。其名称为 FTS_DOC_ID(必须为大写)。该列本身必须为 BIGINT UNSIGNED NOT NULL 类型,并具有名为 FTS_DOC_ID_INDEX 的唯一索引。最好在创建表时定义此列。如果 InnoDB 必须在创建 FULLTEXT 索引时向表中添加该列,则索引操作的成本会显著增加。 In the InnoDB full-text search feature, a special column in the table containing the FULLTEXT index, to uniquely identify the document associated with each ilist value. Its name is FTS_DOC_ID (uppercase required). The column itself must be of BIGINT UNSIGNED NOT NULL type, with a unique index named FTS_DOC_ID_INDEX. Preferably, you define this column when creating the table. If InnoDB must add the column to the table while creating a FULLTEXT index, the indexing operation is considerably more expensive.

另请参见 全文搜索,FULLTEXT 索引,ilist。See Also full-text search, FULLTEXT index, ilist.

双写缓冲区doublewrite buffer

InnoDB 使用一种称为双写的文件刷新技术。在将 页面 写入 数据文件 之前,InnoDB 会先将它们写入一个称为双写缓冲区的存储区域。只有在写入并刷新到双写缓冲区完成后,InnoDB 才会将页面写入数据文件中的正确位置。如果在页面写入过程中操作系统、存储子系统或 mysqld 进程发生崩溃,InnoDB 可以在 崩溃恢复 期间从双写缓冲区找到页面的有效副本。 InnoDB uses a file flush technique called doublewrite. Before writing pages to the data files, InnoDB first writes them to a storage area called the doublewrite buffer. Only after the write and the flush to the doublewrite buffer have completed, does InnoDB write the pages to their proper positions in the data file. If there is an operating system, storage subsystem or mysqld process crash in the middle of a page write, InnoDB can find a good copy of the page from the doublewrite buffer during crash recovery.

虽然数据总是被写入两次,但双写缓冲区并不需要两倍的 I/O 开销或两倍的 I/O 操作。数据作为一个大的连续块写入缓冲区本身,并通过一次 fsync() 调用提交给操作系统。Although data is always written twice, the doublewrite buffer does not require twice as much I/O overhead or twice as many I/O operations. Data is written to the buffer itself as a large sequential chunk, with a single fsync() call to the operating system.

另请参见 崩溃恢复、数据文件、页、清除。See Also crash recovery, data files, page, purge.

删除drop

一种 DDL 操作,用于通过诸如 DROP TABLE 或 DROP INDEX 之类的语句删除模式对象。它在内部映射为 ALTER TABLE 语句。从 InnoDB 的角度来看,此类操作的性能考虑涉及锁定 数据字典 以确保所有相关对象都得到更新的时间,以及更新内存结构(如 缓冲池)的时间。对于 表 来说,删除操作与 截断 操作(TRUNCATE TABLE 语句)具有略微不同的特性。 A kind of DDL operation that removes a schema object, through a statement such as DROP TABLE or DROP INDEX. It maps internally to an ALTER TABLE statement. From an InnoDB perspective, the performance considerations of such operations involve the time that the data dictionary is locked to ensure that interrelated objects are all updated, and the time to update memory structures such as the buffer pool. For a table, the drop operation has somewhat different characteristics than a truncate operation (TRUNCATE TABLE statement).

另请参见 缓冲池,数据字典,DDL,表,截断。See Also buffer pool, data dictionary, DDL, table, truncate.

DSN

Acronym for “Database Source Name”. It is the encoding for connection information within Connector/ODBC。参见Configuring a Connector/ODBC DSN on Windows for full details. It is the equivalent of the connection string used by Connector/NET. Acronym for “Database Source Name”. It is the encoding for connection information within Connector/ODBC. See Configuring a Connector/ODBC DSN on Windows for full details. It is the equivalent of the connection string used by Connector/NET.

另请参见 连接、连接字符串、Connector/NET、Connector/ODBC。See Also connection, connection string, Connector/NET, Connector/ODBC.

动态游标dynamic cursor

一种由 ODBC 支持的 游标 类型,可以在再次读取行时获取新增和更改的结果。更改是否以及多快对游标可见,取决于所涉及的表类型(事务性或非事务性)以及事务性表的隔离级别。必须显式启用对动态游标的支持。 A type of cursor supported by ODBC that can pick up new and changed results when the rows are read again. Whether and how quickly the changes are visible to the cursor depends on the type of table involved (transactional or non-transactional) and the isolation level for transactional tables. Support for dynamic cursors must be explicitly enabled.

另请参见 光标、ODBC。See Also cursor, ODBC.

动态行格式dynamic row format

一种 InnoDB 行格式。由于长变长列值存储在包含行数据的页面之外,它对于包含大型对象的行非常高效。由于这些大字段通常不用于评估查询条件,因此它们不经常被加载到 缓冲池 中,从而减少了 I/O 操作并提高了缓存内存的利用率。 An InnoDB row format. Because long variable-length column values are stored outside of the page that holds the row data, it is very efficient for rows that include large objects. Since the large fields are typically not accessed to evaluate query conditions, they are not brought into the buffer pool as often, resulting in fewer I/O operations and better utilization of cache memory.

从 MySQL 5.7.9 开始,默认行格式由 innodb_default_row_format 定义,其默认值为 DYNAMIC。As of MySQL 5.7.9, the default row format is defined by innodb_default_row_format, which has a default value of DYNAMIC.

关于 InnoDB DYNAMIC 行格式的更多信息,请参见 DYNAMIC 行格式。For additional information about InnoDB DYNAMIC row format, see DYNAMIC Row Format.

另请参见 缓冲池,文件格式,行格式。See Also buffer pool, file format, row format.

动态 SQLdynamic SQL

一种功能,使您能够使用比将语句各部分连接成字符串变量的简单方法更强大、更安全且更高效的方法来创建和执行预处理语句以替换参数值。 A feature that lets you create and execute prepared statements using more robust, secure, and efficient methods to substitute parameter values than the naive technique of concatenating the parts of the statement into a string variable.

另请参见 预处理语句。See Also prepared statement.

动态语句dynamic statement

通过动态 SQL创建并执行的预处理语句。 A prepared statement created and executed through dynamic SQL.

另请参见 动态 SQL, 预处理语句。See Also dynamic SQL, prepared statement.

EE

早期采用者early adopter

类似于 Beta 阶段,当软件产品通常在非关键任务环境中评估其性能、功能和兼容性时的阶段。 A stage similar to beta, when a software product is typically evaluated for performance, functionality, and compatibility in a non-mission-critical setting.

另见 Beta。See Also beta.

Eiffel

一种包含许多面向对象特性的编程语言。它的一些概念对 Java 和 C# 开发者来说很熟悉。有关 MySQL 的开源 Eiffel API,请参见 31.13 节,“MySQL Eiffel 包装器”。 A programming language including many object-oriented features. Some of its concepts are familiar to Java and C# developers. For the open-source Eiffel API for MySQL, see Section 31.13, “MySQL Eiffel Wrapper”.

参见 API,C#,Java。See Also API, C#, Java.

嵌入式embedded

嵌入式 MySQL 服务器库(libmysqld)使在 客户端 应用程序中运行功能完整的 MySQL 服务器成为可能。主要优点是提高速度,并使嵌入式应用程序的管理更简单。 The embedded MySQL server library (libmysqld) makes it possible to run a full-featured MySQL server inside a client application. The main benefits are increased speed and more simple management for embedded applications.

参见 客户端,libmysqld。See Also client, libmysqld.

错误日志error log

一种日志,显示 MySQL 启动信息、关键运行时错误和崩溃信息。详情见 第 7.4.2 节,“错误日志”。 A type of log showing information about MySQL startup and critical runtime errors and crash information. For details, see Section 7.4.2, “The Error Log”.

另请参见 崩溃、日志。See Also crash, log.

逐出eviction

从缓存或其他临时存储区域中移除某个项目的过程,例如 InnoDB 缓冲池。通常,但并非总是,会使用 LRU 算法来确定要移除的项目。当 脏页 被驱逐时,其内容会被 刷新 到磁盘,并且任何脏的 邻页 也可能被刷新。 The process of removing an item from a cache or other temporary storage area, such as the InnoDB buffer pool. Often, but not always, uses the LRU algorithm to determine which item to remove. When a dirty page is evicted, its contents are flushed to disk, and any dirty neighbor pages might be flushed also.

另请参阅 缓冲池、脏页、刷新、LRU、邻页。See Also buffer pool, dirty page, flush, LRU, neighbor page.

异常拦截器exception interceptor

一种用于跟踪、调试或增强数据库应用程序遇到的 SQL 错误的 拦截器 类型。例如,拦截器代码可以发出 SHOW WARNINGS 语句以检索额外信息,并添加描述性文本甚至更改返回给应用程序的异常类型。由于只有在 SQL 语句返回错误时才会调用拦截器代码,因此在正常(无错误)操作期间,它不会对应用程序性能产生任何影响。 A type of interceptor for tracing, debugging, or augmenting SQL errors encountered by a database application. For example, the interceptor code could issue a SHOW WARNINGS statement to retrieve additional information, and add descriptive text or even change the type of the exception returned to the application. Because the interceptor code is only called when SQL statements return errors, it does not impose any performance penalty on the application during normal (error-free) operation.

在使用 Connector/J 的 Java 应用程序中,设置这种类型的拦截器涉及实现 com.mysql.jdbc.ExceptionInterceptor 接口,并向 连接字符串 添加一个 exceptionInterceptors 属性。In Java applications using Connector/J, setting up this type of interceptor involves implementing the com.mysql.jdbc.ExceptionInterceptor interface, and adding a exceptionInterceptors property to the connection string.

在使用 Connector/NET 的 Visual Studio 应用程序中,设置这种类型的拦截器涉及定义一个继承自 BaseExceptionInterceptor 类的类,并在连接字符串中指定该类名。In Visual Studio applications using Connector/NET, setting up this type of interceptor involves defining a class that inherits from the BaseExceptionInterceptor class and specifying that class name as part of the connection string.

另请参阅 Connector/J,Connector/NET,拦截器,Java,Visual Studio。See Also Connector/J, Connector/NET, interceptor, Java, Visual Studio.

排他锁exclusive lock

一种锁,可以防止任何其他事务锁定同一行。根据事务的隔离级别,这种锁可能会阻止其他事务写入同一行,或者也可能阻止其他事务读取同一行。默认的InnoDB隔离级别可重复读通过允许事务读取具有独占锁的行,从而提高了并发性,这种技术称为一致性读。 A kind of lock that prevents any other transaction from locking the same row. Depending on the transaction isolation level, this kind of lock might block other transactions from writing to the same row, or might also block other transactions from reading the same row. The default InnoDB isolation level, REPEATABLE READ, enables higher concurrency by allowing transactions to read rows that have exclusive locks, a technique known as consistent read.

另请参见 并发,一致性读取,隔离级别,锁,可重复读,共享锁,事务。See Also concurrency, consistent read, isolation level, lock, REPEATABLE READ, shared lock, transaction.

区段extent

A group of 预读 within a tablespace. For the default page size of 16KB, an extent contains 64 pages. In MySQL 5.6, the page size for an InnoDB instance can be 4KB, 8KB, or 16KB, controlled by the innodb_page_size configuration option. For 4KB, 8KB, and 16KB pages sizes, the extent size is always 1MB (or 1048576 bytes). A group of pages within a tablespace. For the default page size of 16KB, an extent contains 64 pages. In MySQL 5.6, the page size for an InnoDB instance can be 4KB, 8KB, or 16KB, controlled by the innodb_page_size configuration option. For 4KB, 8KB, and 16KB pages sizes, the extent size is always 1MB (or 1048576 bytes).

在 MySQL 5.7.6 中添加了对 32KB 和 64KB InnoDB 页面大小的支持。对于 32KB 页面大小,区的大小为 2MB。对于 64KB 页面大小,区的大小为 4MB。Support for 32KB and 64KB InnoDB page sizes was added in MySQL 5.7.6. For a 32KB page size, the extent size is 2MB. For a 64KB page size, the extent size is 4MB.

InnoDB 的特性,例如 段、预读 请求和 双写缓冲区 使用的一次 I/O 操作是以单个区(extent)为单位进行读取、写入、分配或释放数据的。InnoDB features such as segments, read-ahead requests and the doublewrite buffer use I/O operations that read, write, allocate, or free data one extent at a time.

另请参见 双写缓冲区、页、页大小、预读、段、表空间。See Also doublewrite buffer, page, page size, read-ahead, segment, tablespace.

FF

.frm 文件.frm file

一个包含 MySQL 表的元数据(例如表定义)的文件。.frm 文件在 MySQL 8.0 中被移除,但在早期的 MySQL 版本中仍然使用。在 MySQL 8.0 中,之前存储在 .frm 文件中的数据存储在 数据字典 表中。 A file containing the metadata, such as the table definition, of a MySQL table. .frm files were removed in MySQL 8.0 but are still used in earlier MySQL releases. In MySQL 8.0, data previously stored in .frm files is stored in data dictionary tables.

另请参阅 数据字典、MySQL 企业备份、系统表空间。See Also data dictionary, MySQL Enterprise Backup, system tablespace.

故障切换failover

在发生故障时能够自动切换到备用服务器的能力。在 MySQL 的上下文中,故障转移涉及一个备用数据库服务器。通常由应用服务器或框架在 J2EE 环境中支持。 The ability to automatically switch to a standby server in the event of a failure. In the MySQL context, failover involves a standby database server. Often supported within J2EE environments by the application server or framework.

另见 Connector/J, J2EE。See Also Connector/J, J2EE.

快速索引创建Fast Index Creation

最初在 InnoDB 插件中引入的功能,现在在 MySQL 5.5 及更高版本中已成为一部分,该功能通过避免完全重写关联表,加快了 InnoDB 二级索引 的创建速度。该加速也适用于删除二级索引。 A capability first introduced in the InnoDB Plugin, now part of MySQL in 5.5 and higher, that speeds up creation of InnoDB secondary indexes by avoiding the need to completely rewrite the associated table. The speedup applies to dropping secondary indexes also.

由于索引维护可能会增加许多数据传输操作的性能开销,因此可以考虑在没有任何二级索引的情况下执行诸如ALTER TABLE ... ENGINE=INNODB或INSERT INTO ... SELECT * FROM ...之类的操作,然后再创建索引。Because index maintenance can add performance overhead to many data transfer operations, consider doing operations such as ALTER TABLE ... ENGINE=INNODB or INSERT INTO ... SELECT * FROM ... without any secondary indexes in place, and creating the indexes afterward.

在 MySQL 5.6 中,这一功能变得更通用。您可以在索引创建过程中对表进行读写操作,并且许多类型的ALTER TABLE操作可以在不复制表、不阻塞DML操作或二者皆不的情况下执行。因此,在 MySQL 5.6 及更高版本中,这组功能被称为在线 DDL,而不是快速索引创建。In MySQL 5.6, this feature becomes more general. You can read and write to tables while an index is being created, and many more kinds of ALTER TABLE operations can be performed without copying the table, without blocking DML operations, or both. Thus in MySQL 5.6 and higher, this set of features is referred to as online DDL rather than Fast Index Creation.

有关相关信息,请参见 第 17.12 节,“InnoDB 与在线 DDL”。For related information, see Section 17.12, “InnoDB and Online DDL”.

另请参见 DML、索引、在线 DDL、辅助索引。See Also DML, index, online DDL, secondary index.

快速关闭fast shutdown

基于配置设置 innodb_fast_shutdown=1,InnoDB 的默认 关闭 程序。为了节省时间,某些 刷新 操作会被跳过。这种类型的关闭在正常使用期间是安全的,因为刷新操作会在下一次启动时执行,使用与 崩溃恢复 相同的机制。在数据库因升级或降级而关闭的情况下,应执行 慢速关闭,以确保所有相关更改在关闭期间应用到 数据文件 中。 The default shutdown procedure for InnoDB, based on the configuration setting innodb_fast_shutdown=1. To save time, certain flush operations are skipped. This type of shutdown is safe during normal usage, because the flush operations are performed during the next startup, using the same mechanism as in crash recovery. In cases where the database is being shut down for an upgrade or downgrade, do a slow shutdown instead to ensure that all relevant changes are applied to the data files during the shutdown.

另请参见 崩溃恢复、数据文件、刷新、关闭、慢速关闭。See Also crash recovery, data files, flush, shutdown, slow shutdown.

文件格式file format

InnoDB 表的文件格式。 The file format for InnoDB tables.

另请参见 每表文件、.ibd 文件、ibdata 文件、行格式。See Also file-per-table, .ibd file, ibdata file, row format.

每表文件file-per-table

这是由 innodb_file_per_table 选项控制的设置的一般名称,该选项是一个重要的配置选项,影响 InnoDB 文件存储、功能可用性和 I/O 特性。从 MySQL 5.6.7 起,innodb_file_per_table 默认启用。 A general name for the setting controlled by the innodb_file_per_table option, which is an important configuration option that affects aspects of InnoDB file storage, availability of features, and I/O characteristics. As of MySQL 5.6.7, innodb_file_per_table is enabled by default.

启用innodb_file_per_table option enabled, you can create a table in its own .ibd file rather than in the shared ibdata files of the system tablespace. When table data is stored in an individual .ibd file, you have more flexibility to choose row formats required for features such as data compression. The TRUNCATE TABLE operation is also faster, and reclaimed space can be used by the operating system rather than remaining reserved for InnoDB.With the innodb_file_per_table option enabled, you can create a table in its own .ibd file rather than in the shared ibdata files of the system tablespace. When table data is stored in an individual .ibd file, you have more flexibility to choose row formats required for features such as data compression. The TRUNCATE TABLE operation is also faster, and reclaimed space can be used by the operating system rather than remaining reserved for InnoDB.

MySQL 企业备份 产品对于存储在其自身文件中的表更为灵活。例如,表可以从备份中排除,但前提是它们在单独的文件中。因此,此设置适用于备份频率较低或按不同时间表备份的表。The MySQL Enterprise Backup product is more flexible for tables that are in their own files. For example, tables can be excluded from a backup, but only if they are in separate files. Thus, this setting is suitable for tables that are backed up less frequently or on a different schedule.

另请参见 压缩行格式、压缩、文件格式、.ibd 文件、ibdata 文件、innodb_file_per_table、MySQL 企业备份、行格式、系统表空间。See Also compressed row format, compression, file format, .ibd file, ibdata file, innodb_file_per_table, MySQL Enterprise Backup, row format, system tablespace.

填充因子fill factor

在一个 InnoDB 索引 中,页 被索引数据占用的比例在页分裂之前称为填充因子。当索引数据首次在页之间分配时的未使用空间允许行在更新为更长的字符串值时无需进行昂贵的索引维护操作。如果填充因子过低,索引会占用比需要更多的空间,从而在读取索引时造成额外的 I/O 负担。如果填充因子过高,任何增加列值长度的更新都会导致索引维护的额外 I/O 负担。有关更多信息,请参见 第 17.6.2.2 节,“InnoDB 索引的物理结构”。 In an InnoDB index, the proportion of a page that is taken up by index data before the page is split. The unused space when index data is first divided between pages allows for rows to be updated with longer string values without requiring expensive index maintenance operations. If the fill factor is too low, the index consumes more space than needed, causing extra I/O overhead when reading the index. If the fill factor is too high, any update that increases the length of column values can cause extra I/O overhead for index maintenance. See Section 17.6.2.2, “The Physical Structure of an InnoDB Index” for more information.

另请参阅 索引, 页。See Also index, page.

固定行格式fixed row format

这种行格式由 MyISAM 存储引擎使用,而不是 InnoDB。如果在 MySQL 5.7.6 或更早版本中使用选项 ROW_FORMAT=FIXED 创建 InnoDB 表,InnoDB 会改为使用 紧凑行格式,尽管在输出中(例如 SHOW TABLE STATUS 报告)FIXED 值仍可能显示。自 MySQL 5.7.7 起,如果指定 ROW_FORMAT=FIXED,InnoDB 将返回错误。 This row format is used by the MyISAM storage engine, not by InnoDB. If you create an InnoDB table with the option ROW_FORMAT=FIXED in MySQL 5.7.6 or earlier, InnoDB uses the compact row format instead, although the FIXED value might still show up in output such as SHOW TABLE STATUS reports. As of MySQL 5.7.7, InnoDB returns an error if ROW_FORMAT=FIXED is specified.

另见 紧凑行格式,行格式。See Also compact row format, row format.

刷新flush

将缓存在内存区域或临时磁盘存储区域中的更改写入数据库文件。InnoDB 存储结构中定期刷新的包括 重做日志、回滚日志 以及 缓冲池。 To write changes to the database files, that had been buffered in a memory area or a temporary disk storage area. The InnoDB storage structures that are periodically flushed include the redo log, the undo log, and the buffer pool.

刷新可能发生的原因是内存区域已满,系统需要释放一些空间,因为 提交 操作意味着事务的更改可以被最终确定,或者因为 缓慢关闭 操作意味着所有未完成的工作都应当被最终确定。当不需要一次性刷新所有缓冲数据时,InnoDB 可以使用一种称为 模糊检查点 的技术,将页面分批刷新以分散 I/O 开销。Flushing can happen because a memory area becomes full and the system needs to free some space, because a commit operation means the changes from a transaction can be finalized, or because a slow shutdown operation means that all outstanding work should be finalized. When it is not critical to flush all the buffered data at once, InnoDB can use a technique called fuzzy checkpointing to flush small batches of pages to spread out the I/O overhead.

另请参见 缓冲池,提交,模糊检查点,重做日志,慢速关闭,回滚日志。See Also buffer pool, commit, fuzzy checkpointing, redo log, slow shutdown, undo log.

刷新列表flush list

一个内部的 InnoDB 数据结构,用于跟踪 脏页 在 缓冲池 中的状态:也就是说,已经被修改并需要写回磁盘的 页。这个数据结构由 InnoDB 内部的 小事务 经常更新,因此它由自己的 互斥锁 保护,以允许对缓冲池的并发访问。 An internal InnoDB data structure that tracks dirty pages in the buffer pool: that is, pages that have been changed and need to be written back out to disk. This data structure is updated frequently by InnoDB internal mini-transactions, and so is protected by its own mutex to allow concurrent access to the buffer pool.

另请参阅 缓冲池,脏页,LRU,微事务,互斥锁,页,页清理器。See Also buffer pool, dirty page, LRU, mini-transaction, mutex, page, page cleaner.

外键foreign key

一种指针类型的关系,存在于不同 InnoDB 表的行之间。外键关系在 父表 和 子表 中的某一列上定义。 A type of pointer relationship, between rows in separate InnoDB tables. The foreign key relationship is defined on one column in both the parent table and the child table.

除了能够快速查找相关信息之外,外键还有助于强制执行参照完整性,通过防止在插入、更新和删除数据时这些指针中的任何一个变得无效。这种执行机制是一种约束。如果一个行指向另一张表,但关联的外键值在另一张表中不存在,则不能插入该行。如果删除一行或其外键值被更改,并且另一张表中的行指向该外键值,则可以设置外键来防止删除、使另一张表中的相应列值变为空,或者自动删除另一张表中的对应行。In addition to enabling fast lookup of related information, foreign keys help to enforce referential integrity, by preventing any of these pointers from becoming invalid as data is inserted, updated, and deleted. This enforcement mechanism is a type of constraint. A row that points to another table cannot be inserted if the associated foreign key value does not exist in the other table. If a row is deleted or its foreign key value changed, and rows in another table point to that foreign key value, the foreign key can be set up to prevent the deletion, cause the corresponding column values in the other table to become null, or automatically delete the corresponding rows in the other table.

设计一个规范化数据库的阶段之一是识别重复的数据,将这些数据分离到一个新表中,并建立外键关系,以便使用连接操作像查询单个表一样查询多个表。One of the stages in designing a normalized database is to identify data that is duplicated, separate that data into a new table, and set up a foreign key relationship so that the multiple tables can be queried like a single table, using a join operation.

另请参阅 子表、外键约束、连接、规范化、NULL、主表、参照完整性、关系型。See Also child table, FOREIGN KEY constraint, join, normalized, NULL, parent table, referential integrity, relational.

外键约束FOREIGN KEY constraint

维护数据库一致性的约束类型,通过外键关系实现。像其他类型的约束一样,如果数据可能变得不一致,它可以阻止数据被插入或更新;在这种情况下,被防止的不一致性是多表之间的数据不一致。或者,当执行DML操作时,FOREIGN KEY约束可以根据创建外键时指定的ON CASCADE选项,导致子行的数据被删除、更改为不同的值,或者设置为空值。 The type of constraint that maintains database consistency through a foreign key relationship. Like other kinds of constraints, it can prevent data from being inserted or updated if data would become inconsistent; in this case, the inconsistency being prevented is between data in multiple tables. Alternatively, when a DML operation is performed, FOREIGN KEY constraints can cause data in child rows to be deleted, changed to different values, or set to null, based on the ON CASCADE option specified when creating the foreign key.

另请参见 子表、约束、DML、外键、NULL。See Also child table, constraint, DML, foreign key, NULL.

FTS

在大多数情况下,是 全文搜索 的缩写。有时在性能讨论中,是 全表扫描 的缩写。 In most contexts, an acronym for full-text search. Sometimes in performance discussions, an acronym for full table scan.

另请参见 全表扫描、全文搜索。See Also full table scan, full-text search.

完整备份full backup

包含每个 MySQL 数据库中所有 表以及 MySQL 实例中所有数据库的 备份。与 部分备份对比。 A backup that includes all the tables in each MySQL database, and all the databases in a MySQL instance. Contrast with partial backup.

另见 备份,数据库,实例,部分备份,表。See Also backup, database, instance, partial backup, table.

全表扫描full table scan

一种操作,需要读取表的全部内容,而不仅仅是使用 索引 选择的部分内容。通常在小型查找表中执行,或者在数据仓库中处理大型表时执行,此时会聚合和分析所有可用数据。这些操作发生的频率以及表的大小相对于可用内存的情况,会影响查询优化和 缓冲池 管理中使用的算法。 An operation that requires reading the entire contents of a table, rather than just selected portions using an index. Typically performed either with small lookup tables, or in data warehousing situations with large tables where all available data is aggregated and analyzed. How frequently these operations occur, and the sizes of the tables relative to available memory, have implications for the algorithms used in query optimization and managing the buffer pool.

索引的目的是允许在大型表中查找特定值或值范围,从而在可行时避免全表扫描。The purpose of indexes is to allow lookups for specific values or ranges of values within a large table, thus avoiding full table scans when practical.

参见 缓冲池,索引。See Also buffer pool, index.

全文搜索full-text search

MySQL 用于在表数据中查找单词、短语、单词的布尔组合等的功能,比使用 SQL LIKE 操作符或编写自己的应用级搜索算法更快、更方便、更灵活。它使用 SQL 函数 MATCH() 和 FULLTEXT 索引。 The MySQL feature for finding words, phrases, Boolean combinations of words, and so on within table data, in a faster, more convenient, and more flexible way than using the SQL LIKE operator or writing your own application-level search algorithm. It uses the SQL function MATCH() and FULLTEXT indexes.

另请参见 FULLTEXT 索引。See Also FULLTEXT index.

FULLTEXT 索引FULLTEXT index

MySQL 全文搜索机制中用于存储搜索索引的特殊类型的索引。表示列值中的单词,省略任何被指定为停用词的单词。最初,仅适用于MyISAM表。从 MySQL 5.6.4 起,它也适用于InnoDB表。 The special kind of index that holds the search index in the MySQL full-text search mechanism. Represents the words from values of a column, omitting any that are specified as stopwords. Originally, only available for MyISAM tables. Starting in MySQL 5.6.4, it is also available for InnoDB tables.

另请参阅 全文搜索、索引、InnoDB、搜索索引、停用词。See Also full-text search, index, InnoDB, search index, stopword.

模糊检查点fuzzy checkpointing

一种技术,可从 缓冲池中刷新少量的脏页,而不是一次性刷新所有脏页,这样会干扰数据库处理。 A technique that flushes small batches of dirty pages from the buffer pool, rather than flushing all dirty pages at once which would disrupt database processing.

另请参见 缓冲池、脏页、刷写。See Also buffer pool, dirty page, flush.

GG

GA

“一般可用”,指软件产品离开 测试版 阶段,并可供销售、官方支持和生产使用的阶段。 “Generally available”, the stage when a software product leaves beta and is available for sale, official support, and production use.

另见 Beta。See Also beta.

GAC

Acronym for “Global Assembly Cache”. A central area for storing libraries (assemblies) on a .NET system. Physically consists of nested folders, treated as a single virtual folder by the .NET CLR.

另请参见 .NET,程序集。See Also .NET, assembly.

间隙gap

在 InnoDB 索引 数据结构中可以插入新值的位置。当你使用诸如 SELECT ... FOR UPDATE 的语句锁定一组行时,InnoDB 可以创建既作用于间隙也作用于索引中实际值的锁。例如,如果你选择所有大于 10 的值进行更新,间隙锁会防止其他事务插入一个大于 10 的新值。上确界记录 和 下确界记录 表示包含所有大于或小于当前索引值的间隙。 A place in an InnoDB index data structure where new values could be inserted. When you lock a set of rows with a statement such as SELECT ... FOR UPDATE, InnoDB can create locks that apply to the gaps as well as the actual values in the index. For example, if you select all values greater than 10 for update, a gap lock prevents another transaction from inserting a new value that is greater than 10. The supremum record and infimum record represent the gaps containing all values greater than or less than all the current index values.

另请参见 并发,间隙锁,索引,下界记录,隔离级别,上界记录。See Also concurrency, gap lock, index, infimum record, isolation level, supremum record.

间隙锁gap lock

A lock on a 间隙 between index records, or a lock on the gap before the first or after the last index record. For example, SELECT c1 FROM t WHERE c1 BETWEEN 10 and 20 FOR UPDATE; prevents other transactions from inserting a value of 15 into the column t.c1, whether or not there was already any such value in the column, because the gaps between all existing values in the range are locked. Contrast with record lock以及next-key lock. A lock on a gap between index records, or a lock on the gap before the first or after the last index record. For example, SELECT c1 FROM t WHERE c1 BETWEEN 10 and 20 FOR UPDATE; prevents other transactions from inserting a value of 15 into the column t.c1, whether or not there was already any such value in the column, because the gaps between all existing values in the range are locked. Contrast with record lock and next-key lock.

空隙锁是性能与 并发性 之间权衡的一部分,并且在某些事务 隔离级别 中使用,而在其他隔离级别中不使用。Gap locks are part of the tradeoff between performance and concurrency, and are used in some transaction isolation levels and not others.

另见 空隙,下确界记录,锁,下一个键锁,记录锁,上确界记录。See Also gap, infimum record, lock, next-key lock, record lock, supremum record.

通用日志general log

见 通用查询日志。See general query log.

通用查询日志general query log

一种用于诊断和排查 MySQL 服务器处理的 SQL 语句的 日志。可以存储在文件中或表中。要使用此功能,必须通过 general_log 配置选项启用它。你可以通过 sql_log_off 配置选项为特定连接禁用它。 A type of log used for diagnosis and troubleshooting of SQL statements processed by the MySQL server. Can be stored in a file or in a database table. You must enable this feature through the general_log configuration option to use it. You can disable it for a specific connection through the sql_log_off configuration option.

记录的查询范围比慢查询日志更广。与用于复制的二进制日志不同,通用查询日志包含SELECT语句,并且不保持严格的顺序。更多信息,请参见第 7.4.3 节,“通用查询日志”。Records a broader range of queries than the slow query log. Unlike the binary log, which is used for replication, the general query log contains SELECT statements and does not maintain strict ordering. For more information, see Section 7.4.3, “The General Query Log”.

另请参见 二进制日志、日志、慢查询日志。See Also binary log, log, slow query log.

通用表空间general tablespace

使用 CREATE TABLESPACE 语法创建的共享 InnoDB 表空间。通用表空间可以在 MySQL 数据目录外创建,能够容纳多个 表,并支持所有行格式的表。通用表空间是在 MySQL 5.7.6 中引入的。 A shared InnoDB tablespace created using CREATE TABLESPACE syntax. General tablespaces can be created outside of the MySQL data directory, are capable of holding multiple tables, and support tables of all row formats. General tablespaces were introduced in MySQL 5.7.6.

表可以使用 CREATE TABLE tbl_name ... TABLESPACE [=] tablespace_name 或 ALTER TABLE tbl_name TABLESPACE [=] tablespace_name 语法添加到通用表空间中。Tables are added to a general tablespace using CREATE TABLE tbl_name ... TABLESPACE [=] tablespace_name or ALTER TABLE tbl_name TABLESPACE [=] tablespace_name syntax.

与 系统表空间 和 每表文件表空间 相对照。Contrast with system tablespace and file-per-table tablespace.

更多信息,请参见 第 17.6.3.3 节,“通用表空间”。For more information, see Section 17.6.3.3, “General Tablespaces”.

另请参见 每表文件、系统表空间、表、表空间。See Also file-per-table, system tablespace, table, tablespace.

生成列generated column

一列,其值由包含在列定义中的表达式计算得出。生成列可以是 虚拟 或 存储 的。 A column whose values are computed from an expression included in the column definition. A generated column can be virtual or stored.

参见 基本列,存储生成列,虚拟生成列。See Also base column, stored generated column, virtual generated column.

生成的存储列generated stored column

参见 存储生成列。See stored generated column.

生成的虚拟列generated virtual column

参见 虚拟生成列。See virtual generated column.

Glassfish

参见 J2EE。See Also J2EE.

全局临时表空间global temporary tablespace

一个临时表空间,用于存储用户创建的临时表所进行更改的回滚段。 A temporary tablespace that stores rollback segments for changes made to user-created temporary tables.

另请参见 临时表空间。See Also temporary tablespace.

全局事务global transaction

一种涉及 XA 操作的 事务 类型。它由若干本身是事务的操作组成,但所有操作必须要么作为一个整体成功完成,要么全部回滚。实质上,这扩展了 ACID 特性 “提升一级”,使得多个 ACID 事务能够协同执行,作为也具有 ACID 特性的全局操作的组成部分。 A type of transaction involved in XA operations. It consists of several actions that are transactional in themselves, but that all must either complete successfully as a group, or all be rolled back as a group. In essence, this extends ACID properties “up a level” so that multiple ACID transactions can be executed in concert as components of a global operation that also has ACID properties.

参见 ACID、事务、XA。See Also ACID, transaction, XA.

分组提交group commit

一种 InnoDB 优化,它对一组 提交 操作仅执行一次某些低级别的 I/O 操作(日志写入),而不是为每个提交单独刷新和同步。 An InnoDB optimization that performs some low-level I/O operations (log write) once for a set of commit operations, rather than flushing and syncing separately for each commit.

另见 二进制日志, 提交。See Also binary log, commit.

全局唯一标识符 (GUID)GUID

Acronym for “globally unique identifier”, an ID value that can be used to associate data across different databases, languages, operating systems, and so on. (As an alternative to using sequential integers, where the same values could appear in different tables, databases, and so on referring to different data.) Older MySQL versions represented it as BINARY(16). Currently, it is represented as CHAR(36). MySQL has a UUID() function that returns GUID values in character format, and a UUID_SHORT() function that returns GUID values in integer format. Because successive GUID values are not necessarily in ascending sort order, it is not an efficient value to use as a primary key for large InnoDB tables.

HH

哈希索引hash index

一种用于使用等值运算符而不是大于或 BETWEEN 等范围运算符的查询的 索引 类型。它适用于 MEMORY 表。尽管出于历史原因哈希索引是 MEMORY 表的默认索引,但该存储引擎也支持 B 树 索引,对于通用查询通常是更好的选择。 A type of index intended for queries that use equality operators, rather than range operators such as greater-than or BETWEEN. It is available for MEMORY tables. Although hash indexes are the default for MEMORY tables for historic reasons, that storage engine also supports B-tree indexes, which are often a better choice for general-purpose queries.

MySQL 包含这种索引类型的一个变体,自适应哈希索引,如果需要,它会根据运行时条件自动为InnoDB表构建。MySQL includes a variant of this index type, the adaptive hash index, that is constructed automatically for InnoDB tables if needed based on runtime conditions.

另请参见 自适应哈希索引、B 树、索引、InnoDB。See Also adaptive hash index, B-tree, index, InnoDB.

HDD

Acronym for “hard disk drive”. Refers to storage media using spinning platters, usually when comparing and contrasting with SSD. Its performance characteristics can influence the throughput of a disk-based workload.

另见 基于磁盘,SSD。See Also disk-based, SSD.

心跳heartbeat

定期发送的一条消息,用于指示系统运行正常。在复制环境中,如果源停止发送此类消息,其中一个副本可以接替它的位置。类似的技术可以在集群环境中的服务器之间使用,以确认它们全部正常运行。 A periodic message that is sent to indicate that a system is functioning properly. In a replication context, if the source stops sending such messages, one of the replicas can take its place. Similar techniques can be used between the servers in a cluster environment, to confirm that all of them are operating properly.

另请参见 复制,源。See Also replication, source.

高水位标记high-water mark

表示上限的值,可以是运行时不应超过的硬性上限,也可以是实际达到的最大值的记录。与低水位标记形成对比。 A value representing an upper limit, either a hard limit that should not be exceeded at runtime, or a record of the maximum value that was actually reached. Contrast with low-water mark.

另请参见 低水位标记。See Also low-water mark.

历史列表history list

有一份 事务 列表,其中包含计划由 InnoDB 清除 操作处理的已标记删除的记录。记录在 撤销日志 中。历史列表的长度由命令 SHOW ENGINE INNODB STATUS 报告。如果历史列表长度超过 innodb_max_purge_lag 配置选项的值,每个 DML 操作会稍微延迟,以允许清除操作完成 刷新 已删除的记录。 A list of transactions with delete-marked records scheduled to be processed by the InnoDB purge operation. Recorded in the undo log. The length of the history list is reported by the command SHOW ENGINE INNODB STATUS. If the history list grows longer than the value of the innodb_max_purge_lag configuration option, each DML operation is delayed slightly to allow the purge operation to finish flushing the deleted records.

也称为 清除延迟。Also known as purge lag.

另请参见 DML、刷新(flush)、清除(purge)、清除延迟(purge lag)、回滚段(rollback segment)、事务(transaction)、回滚日志(undo log)。See Also DML, flush, purge, purge lag, rollback segment, transaction, undo log.

空洞打孔(hole punching)hole punching

从页面释放空块。InnoDB 透明页面压缩 功能依赖于孔打支持。欲了解更多信息,请参见 第 17.9.2 节,“InnoDB 页面压缩”。 Releasing empty blocks from a page. The InnoDB transparent page compression feature relies on hole punching support. For more information, see Section 17.9.2, “InnoDB Page Compression”.

另请参阅 稀疏文件,透明页面压缩。See Also sparse file, transparent page compression.

主机host

数据库服务器的网络名称,用于建立连接。通常与端口一起指定。在某些情况下,IP 地址127.0.0.1比特殊名称localhost更适合访问与应用程序在同一服务器上的数据库。 The network name of a database server, used to establish a connection. Often specified in conjunction with a port. In some contexts, the IP address 127.0.0.1 works better than the special name localhost for accessing a database on the same server as the application.

另请参见 连接、localhost、端口。See Also connection, localhost, port.

热hot

一种情况,其中某行、表或内部数据结构被访问得非常频繁,需要某种形式的锁定或互斥,从而导致性能或可扩展性问题。 A condition where a row, table, or internal data structure is accessed so frequently, requiring some form of locking or mutual exclusion, that it results in a performance or scalability issue.

虽然“热”通常表示一个不希望出现的情况,但热备份是首选的备份类型。Although “hot” typically indicates an undesirable condition, a hot backup is the preferred type of backup.

另请参见 热备份。See Also hot backup.

热备份hot backup

当数据库正在运行且应用程序正在对其进行读写操作时所进行的备份。备份不仅仅是简单地复制数据文件:它必须包括备份过程中插入或更新的任何数据;必须排除备份过程中删除的任何数据;并且必须忽略任何未提交的更改。 A backup taken while the database is running and applications are reading and writing to it. The backup involves more than simply copying data files: it must include any data that was inserted or updated while the backup was in process; it must exclude any data that was deleted while the backup was in process; and it must ignore any changes that were not committed.

执行热备份的 Oracle 产品,尤其是针对 InnoDB 表,同时也适用于 MyISAM 表和其他存储引擎的表,被称为 MySQL 企业备份。The Oracle product that performs hot backups, of InnoDB tables especially but also tables from MyISAM and other storage engines, is known as MySQL Enterprise Backup.

热备份过程包括两个阶段。初始的数据文件复制会生成一个 原始备份。应用 步骤会合并备份运行期间数据库发生的任何变化。应用这些变化会生成一个 准备好的 备份;这些文件随时可以恢复。The hot backup process consists of two stages. The initial copying of the data files produces a raw backup. The apply step incorporates any changes to the database that happened while the backup was running. Applying the changes produces a prepared backup; these files are ready to be restored whenever necessary.

另见 应用, MySQL 企业备份, 准备好的备份, 原始备份。See Also apply, MySQL Enterprise Backup, prepared backup, raw backup.

II

.ibd 文件.ibd file

每表文件表空间 和一般表空间的数据文件。每表文件表空间 .ibd 文件包含单个表及其关联的索引数据。一般表空间 .ibd 文件可能包含多个表的表和索引数据。 The data file for file-per-table tablespaces and general tablespaces. File-per-table tablespace .ibd files contain a single table and associated index data. General tablespace .ibd files may contain table and index data for multiple tables.

.ibd 文件扩展名不适用于系统表空间,系统表空间由一个或多个ibdata 文件组成。The .ibd file extension does not apply to the system tablespace, which consists of one or more ibdata files.

如果使用 DATA DIRECTORY = 子句创建了每表文件表空间或一般表空间,.ibd 文件将位于指定路径,而不是在普通数据目录内。If a file-per-table tablespace or general tablespace is created with the DATA DIRECTORY = clause, the .ibd file is located at the specified path, outside the normal data directory.

当 .ibd 文件被 MySQL 企业备份 产品包含在压缩备份中时,压缩后的文件对应为 .ibz 文件。When a .ibd file is included in a compressed backup by the MySQL Enterprise Backup product, the compressed equivalent is a .ibz file.

另见 数据库,每表文件,通用表空间,ibdata 文件,.ibz 文件,innodb_file_per_table,MySQL 企业备份,系统表空间。See Also database, file-per-table, general tablespace, ibdata file, .ibz file, innodb_file_per_table, MySQL Enterprise Backup, system tablespace.

.ibz 文件.ibz file

当 MySQL 企业备份 产品执行 压缩备份 时,它会将使用 每表文件 设置创建的每个 表空间 文件的扩展名从 .ibd 转换为 .ibz。 When the MySQL Enterprise Backup product performs a compressed backup, it transforms each tablespace file that is created using the file-per-table setting from a .ibd extension to a .ibz extension.

在备份期间应用的压缩不同于在正常操作期间保持表数据压缩的 压缩行格式。对于已经使用压缩行格式的表空间,压缩备份操作会跳过压缩步骤,因为再次压缩会减慢备份速度,但几乎不会或根本不会节省空间。The compression applied during backup is distinct from the compressed row format that keeps table data compressed during normal operation. A compressed backup operation skips the compression step for a tablespace that is already in compressed row format, as compressing a second time would slow down the backup but produce little or no space savings.

参见 压缩备份、压缩行格式、每表文件、.ibd 文件、MySQL 企业备份、表空间。See Also compressed backup, compressed row format, file-per-table, .ibd file, MySQL Enterprise Backup, tablespace.

I/O 绑定I/O-bound

参见 磁盘绑定。See disk-bound.

ib-文件集ib-file set

由 InnoDB 在 MySQL 数据库中管理的一组文件:系统表空间、每表文件表空间 文件,以及 重做日志 文件。根据 MySQL 版本和 InnoDB 配置,也可能包括 通用表空间、临时表空间 和 撤销表空间 文件。该术语有时在讨论 InnoDB 文件结构和格式的详细内容时使用,用以指代由 InnoDB 在 MySQL 数据库中管理的文件集合。 The set of files managed by InnoDB within a MySQL database: the system tablespace, file-per-table tablespace files, and redo log files. Depending on MySQL version and InnoDB configuration, may also include general tablespace, temporary tablespace, and undo tablespace files. This term is sometimes used in detailed discussions of InnoDB file structures and formats to refer to the set of files managed by InnoDB within a MySQL database.

另请参阅 数据库、每表文件、通用表空间、重做日志、系统表空间、临时表空间、回滚表空间。See Also database, file-per-table, general tablespace, redo log, system tablespace, temporary tablespace, undo tablespace.

ibbackup_logfile

由 MySQL 企业备份 产品在 热备份 操作期间创建的补充备份文件。它包含在备份运行期间发生的任何数据更改的信息。初始备份文件,包括 ibbackup_logfile,被称为 原始备份,因为备份操作期间发生的更改尚未合并。执行 应用 步骤到原始备份文件后,生成的文件确实包含了最终的数据更改,并被称为 已准备备份。在此阶段,ibbackup_logfile 文件不再是必需的。 A supplemental backup file created by the MySQL Enterprise Backup product during a hot backup operation. It contains information about any data changes that occurred while the backup was running. The initial backup files, including ibbackup_logfile, are known as a raw backup, because the changes that occurred during the backup operation are not yet incorporated. After you perform the apply step to the raw backup files, the resulting files do include those final data changes, and are known as a prepared backup. At this stage, the ibbackup_logfile file is no longer necessary.

另请参见 应用、热备份、MySQL 企业备份、准备备份、原始备份。See Also apply, hot backup, MySQL Enterprise Backup, prepared backup, raw backup.

ibdata 文件ibdata file

一组文件,名称如 ibdata1、ibdata2 等,它们组成了 InnoDB 系统表空间。有关系统表空间 ibdata 文件中所包含的结构和数据的信息,请参见 第 17.6.3.1 节,“系统表空间”。 A set of files with names such as ibdata1, ibdata2, and so on, that make up the InnoDB system tablespace. For information about the structures and data that reside in the system tablespace ibdata files, see Section 17.6.3.1, “The System Tablespace”.

ibdata 文件的增长受到 innodb_autoextend_increment 配置选项的影响。Growth of the ibdata files is influenced by the innodb_autoextend_increment configuration option.

参见 更改缓冲区、数据字典、双写缓冲区、每表文件、.ibd 文件、innodb_file_per_table、系统表空间、撤销日志。See Also change buffer, data dictionary, doublewrite buffer, file-per-table, .ibd file, innodb_file_per_table, system tablespace, undo log.

ibtmp 文件ibtmp file

用于非压缩 InnoDB 临时表 及相关对象的 InnoDB 临时表空间 数据文件。配置文件选项 innodb_temp_data_file_path 允许用户定义临时表空间数据文件的相对路径。如果未指定 innodb_temp_data_file_path,默认行为是在数据目录中创建一个名为 ibtmp1 的 12MB 自动扩展数据文件,与 ibdata1 并列。 The InnoDB temporary tablespace data file for non-compressed InnoDB temporary tables and related objects. The configuration file option, innodb_temp_data_file_path, allows users to define a relative path for the temporary tablespace data file. If innodb_temp_data_file_path is not specified, the default behavior is to create a single auto-extending 12MB data file named ibtmp1 in the data directory, alongside ibdata1.

另请参阅 数据文件、临时表、临时表空间。See Also data files, temporary table, temporary tablespace.

ib_logfile

一组文件,通常命名为 ib_logfile0 和 ib_logfile1,组成了 重做日志。有时也称为 日志组。这些文件记录尝试更改 InnoDB 表中数据的语句。在崩溃后启动时,这些语句会被自动重放,以纠正未完成事务写入的数据。 A set of files, typically named ib_logfile0 and ib_logfile1, that form the redo log. Also sometimes referred to as the log group. These files record statements that attempt to change data in InnoDB tables. These statements are replayed automatically to correct data written by incomplete transactions, on startup following a crash.

这些数据不能用于手动恢复;对于这种类型的操作,请使用 二进制日志。This data cannot be used for manual recovery; for that type of operation, use the binary log.

另请参见 二进制日志、日志组、重做日志。See Also binary log, log group, redo log.

ilist

在 InnoDB 全文索引 中,由文档 ID 和标记的位置信息(即特定单词)组成的数据结构。 Within an InnoDB FULLTEXT index, the data structure consisting of a document ID and positional information for a token (that is, a particular word).

另请参见 FULLTEXT 索引。See Also FULLTEXT index.

隐式行锁implicit row lock

A row lock that InnoDB acquires to ensure consistency, without you specifically requesting it.

参见 行锁。See Also row lock.

内存数据库in-memory database

一种将数据保存在内存中的数据库系统,以避免由于磁盘 I/O 和磁盘块与内存区域之间转换造成的开销。一些内存数据库会牺牲持久性(“D” 在 ACID 设计理念中)并容易受到硬件、电源及其他类型故障的影响,因此更适合只读操作。其他内存数据库则使用持久性机制,例如将更改记录到磁盘或使用非易失性内存。 A type of database system that maintains data in memory, to avoid overhead due to disk I/O and translation between disk blocks and memory areas. Some in-memory databases sacrifice durability (the “D” in the ACID design philosophy) and are vulnerable to hardware, power, and other types of failures, making them more suitable for read-only operations. Other in-memory databases do use durability mechanisms such as logging changes to disk or using non-volatile memory.

MySQL 处理同类型内存密集型操作的功能包括 InnoDB 缓冲池、自适应哈希索引 和 只读事务 优化,MEMORY 存储引擎、MyISAM 键缓存,以及 MySQL 查询缓存。MySQL features that address the same kinds of memory-intensive processing include the InnoDB buffer pool, adaptive hash index, and read-only transaction optimization, the MEMORY storage engine, the MyISAM key cache, and the MySQL query cache.

另请参见 ACID,自适应哈希索引,缓冲池,基于磁盘,只读事务。See Also ACID, adaptive hash index, buffer pool, disk-based, read-only transaction.

增量备份incremental backup

一种由 MySQL 企业备份 产品执行的 热备份 类型,它只保存自某个时间点以来发生更改的数据。拥有完整备份和一系列增量备份可以让您在较长时间内重建备份数据,而无需保留多个完整备份所带来的存储开销。您可以先恢复完整备份,然后依次应用每个增量备份,或者通过将每个增量备份应用到完整备份中,使其保持最新状态,然后执行一次恢复操作。 A type of hot backup, performed by the MySQL Enterprise Backup product, that only saves data changed since some point in time. Having a full backup and a succession of incremental backups lets you reconstruct backup data over a long period, without the storage overhead of keeping several full backups on hand. You can restore the full backup and then apply each of the incremental backups in succession, or you can keep the full backup up-to-date by applying each incremental backup to it, then perform a single restore operation.

更改数据的粒度为 页 级别。一个页实际上可能包含多行。每个更改的页都会包含在备份中。The granularity of changed data is at the page level. A page might actually cover more than one row. Each changed page is included in the backup.

另请参见 热备份、MySQL 企业备份、页。See Also hot backup, MySQL Enterprise Backup, page.

索引index

一种数据结构,为 表的 行 提供快速查找能力,通常通过形成一个树结构 (B 树) 来表示某一 列 或若干列的所有值。 A data structure that provides a fast lookup capability for rows of a table, typically by forming a tree structure (B-tree) representing all the values of a particular column or set of columns.

InnoDB 表总是有一个 聚簇索引 来表示 主键。它们还可以在一个或多个列上定义一个或多个 二级索引。根据其结构,二级索引可以被分类为 部分、列 或 复合 索引。InnoDB tables always have a clustered index representing the primary key. They can also have one or more secondary indexes defined on one or more columns. Depending on their structure, secondary indexes can be classified as partial, column, or composite indexes.

索引是查询性能的关键方面。数据库架构师设计表、查询和索引,以便应用程序所需的数据可以快速查找。理想的数据库设计在可行的情况下使用覆盖索引;查询结果完全从索引计算,而不读取实际的表数据。每个外键约束也需要一个索引,以便高效地检查值是否同时存在于父表和子表中。Indexes are a crucial aspect of query performance. Database architects design tables, queries, and indexes to allow fast lookups for data needed by applications. The ideal database design uses a covering index where practical; the query results are computed entirely from the index, without reading the actual table data. Each foreign key constraint also requires an index, to efficiently check whether values exist in both the parent and child tables.

虽然 B 树索引是最常见的,但对于 哈希索引,使用的是不同类型的数据结构,例如在 MEMORY 存储引擎和 InnoDB 自适应哈希索引 中。R 树 索引用于多维信息的空间索引。Although a B-tree index is the most common, a different kind of data structure is used for hash indexes, as in the MEMORY storage engine and the InnoDB adaptive hash index. R-tree indexes are used for spatial indexing of multi-dimensional information.

另请参见 自适应哈希索引、B 树、子表、聚簇索引、列索引、复合索引、覆盖索引、外键、哈希索引、父表、部分索引、主键、查询、R 树、行、二级索引、表。See Also adaptive hash index, B-tree, child table, clustered index, column index, composite index, covering index, foreign key, hash index, parent table, partial index, primary key, query, R-tree, row, secondary index, table.

索引缓存index cache

一个内存区域,用于保存 InnoDB 全文搜索 的分词数据。它缓冲数据,以在向属于 FULLTEXT 索引 的列中插入或更新数据时尽量减少磁盘 I/O。当索引缓存变满时,分词数据会写入磁盘。每个 InnoDB FULLTEXT 索引都有自己的独立索引缓存,其大小由配置选项 innodb_ft_cache_size 控制。 A memory area that holds the token data for InnoDB full-text search. It buffers the data to minimize disk I/O when data is inserted or updated in columns that are part of a FULLTEXT index. The token data is written to disk when the index cache becomes full. Each InnoDB FULLTEXT index has its own separate index cache, whose size is controlled by the configuration option innodb_ft_cache_size.

另请参见 全文搜索,FULLTEXT 索引。See Also full-text search, FULLTEXT index.

索引条件下推index condition pushdown

索引条件下推(ICP)是一种优化技术,如果条件的一部分可以使用索引中的字段进行评估,就会将 WHERE 条件的部分内容下推到存储引擎。ICP 可以减少 存储引擎 访问基表的次数,以及 MySQL 服务器访问存储引擎的次数。更多信息,请参见 第 10.2.1.6 节,“索引条件下推优化”。 Index condition pushdown (ICP) is an optimization that pushes part of a WHERE condition down to the storage engine if parts of the condition can be evaluated using fields from the index. ICP can reduce the number of times the storage engine must access the base table and the number of times the MySQL server must access the storage engine. For more information, see Section 10.2.1.6, “Index Condition Pushdown Optimization”.

另见 索引,存储引擎。See Also index, storage engine.

索引提示index hint

扩展 SQL 语法,用于覆盖优化器推荐的 索引。例如,FORCE INDEX、USE INDEX 和 IGNORE INDEX 子句。通常在索引列值分布不均,导致 基数估计不准确时使用。 Extended SQL syntax for overriding the indexes recommended by the optimizer. For example, the FORCE INDEX, USE INDEX, and IGNORE INDEX clauses. Typically used when indexed columns have unevenly distributed values, resulting in inaccurate cardinality estimates.

另请参见 基数,索引。See Also cardinality, index.

索引前缀index prefix

在适用于多列的索引(称为复合索引)中,索引的初始或前导列。即使查询没有引用索引中的所有列,引用复合索引的前 1、2、3 列等的查询也可以使用该索引。 In an index that applies to multiple columns (known as a composite index), the initial or leading columns of the index. A query that references the first 1, 2, 3, and so on columns of a composite index can use the index, even if the query does not reference all the columns in the index.

另请参见 复合索引, 索引。See Also composite index, index.

索引统计信息index statistics

参见 统计信息。See statistics.

下界记录infimum record

索引中的伪记录,表示该索引中最小值以下的间隙。如果一个事务有类似 SELECT ... FROM ... WHERE col < 10 FOR UPDATE; 的语句,而该列中的最小值是 5,那么这是对该下确界记录的锁,它防止其他事务插入更小的值,如 0、-10 等。 A pseudo-record in an index, representing the gap below the smallest value in that index. If a transaction has a statement such as SELECT ... FROM ... WHERE col < 10 FOR UPDATE;, and the smallest value in the column is 5, it is a lock on the infimum record that prevents other transactions from inserting even smaller values such as 0, -10, and so on.

另请参见 间隙、索引、伪记录、上确界记录。See Also gap, index, pseudo-record, supremum record.

INFORMATION_SCHEMA

提供 MySQL 数据字典 查询接口的 数据库 的名称。(这个名称由 ANSI SQL 标准定义。)要检查关于数据库的信息(元数据),你可以查询诸如 INFORMATION_SCHEMA.TABLES 和 INFORMATION_SCHEMA.COLUMNS 等表,而不是使用产生非结构化输出的 SHOW 命令。 The name of the database that provides a query interface to the MySQL data dictionary. (This name is defined by the ANSI SQL standard.) To examine information (metadata) about the database, you can query tables such as INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS, rather than using SHOW commands that produce unstructured output.

INFORMATION_SCHEMA 数据库还包含针对 InnoDB 的特定表,这些表提供了访问 InnoDB 数据字典的查询接口。使用这些表的目的是获取关于 InnoDB 表运行情况的实时信息,而不是查看数据库的结构,从而帮助进行性能监控、调优和故障排除。The INFORMATION_SCHEMA database also contains tables specific to InnoDB that provide a query interface to the InnoDB data dictionary. You use these tables not to see how the database is structured, but to get real-time information about the workings of InnoDB tables to help with performance monitoring, tuning, and troubleshooting.

另请参见 数据字典、数据库、InnoDB。See Also data dictionary, database, InnoDB.

InnoDB

一个 MySQL 组件,结合了高性能和事务性功能,以实现可靠性、稳健性和并发访问。它体现了ACID设计理念。以存储引擎的形式表示;它处理使用ENGINE=INNODB子句创建或修改的表。有关架构细节和管理程序,请参阅第 17 章,InnoDB 存储引擎,有关性能建议,请参阅第 10.5 节,“优化 InnoDB 表”。 A MySQL component that combines high performance with transactional capability for reliability, robustness, and concurrent access. It embodies the ACID design philosophy. Represented as a storage engine; it handles tables created or altered with the ENGINE=INNODB clause. See Chapter 17, The InnoDB Storage Engine for architectural details and administration procedures, and Section 10.5, “Optimizing for InnoDB Tables” for performance advice.

在 MySQL 5.5 及更高版本中,InnoDB 是新建表的默认存储引擎,因此不需要 ENGINE=INNODB 子句。In MySQL 5.5 and higher, InnoDB is the default storage engine for new tables and the ENGINE=INNODB clause is not required.

InnoDB 表非常适合进行 热备份。有关使用 MySQL Enterprise Backup 产品在不干扰正常处理的情况下备份 MySQL 服务器的信息,请参见 第 32.1 节,“MySQL Enterprise Backup 概述”。InnoDB tables are ideally suited for hot backups. See Section 32.1, “MySQL Enterprise Backup Overview” for information about the MySQL Enterprise Backup product for backing up MySQL servers without interrupting normal processing.

另请参见 ACID、热备份、MySQL 企业备份、存储引擎、事务。See Also ACID, hot backup, MySQL Enterprise Backup, storage engine, transaction.

innodb_autoinc_lock_mode

innodb_autoinc_lock_mode 选项控制 自增锁定 使用的算法。当你有一个自增的 主键 时,只有在设置为 innodb_autoinc_lock_mode=1 时,才能使用基于语句的复制。这个设置被称为 连续 锁模式,因为事务内的多行插入会获得连续的自增值。如果你设置 innodb_autoinc_lock_mode=2,它允许插入操作有更高的并发性,应使用基于行的复制而不是基于语句的复制。这个设置被称为 交错 锁模式,因为多个同时运行的多行插入语句可以获得交错的 自增 值。除了兼容性目的外,不应使用设置 innodb_autoinc_lock_mode=0。 The innodb_autoinc_lock_mode option controls the algorithm used for auto-increment locking. When you have an auto-incrementing primary key, you can use statement-based replication only with the setting innodb_autoinc_lock_mode=1. This setting is known as consecutive lock mode, because multi-row inserts within a transaction receive consecutive auto-increment values. If you have innodb_autoinc_lock_mode=2, which allows higher concurrency for insert operations, use row-based replication rather than statement-based replication. This setting is known as interleaved lock mode, because multiple multi-row insert statements running at the same time can receive auto-increment values that are interleaved. The setting innodb_autoinc_lock_mode=0 should not be used except for compatibility purposes.

连续锁模式 (innodb_autoinc_lock_mode=1) 是 MySQL 8.0.3 之前的默认设置。从 MySQL 8.0.3 开始,交错锁模式 (innodb_autoinc_lock_mode=2) 成为默认设置,这反映了默认复制类型从基于语句的复制变为基于行的复制的变化。Consecutive lock mode (innodb_autoinc_lock_mode=1) is the default setting prior to MySQL 8.0.3. As of MySQL 8.0.3, interleaved lock mode (innodb_autoinc_lock_mode=2) is the default, which reflects the change from statement-based to row-based replication as the default replication type.

另请参见 自动增量、自动增量锁定、混合模式插入、主键。See Also auto-increment, auto-increment locking, mixed-mode insert, primary key.

innodb_file_per_table

一个重要的配置选项,影响 InnoDB 文件存储的许多方面、功能的可用性以及 I/O 特性。在 MySQL 5.6.7 及更高版本中,它默认启用。innodb_file_per_table 选项启用 每表单文件 模式。启用此模式后,新创建的 InnoDB 表及其相关索引可以存储在每表单文件的 .ibd 文件 中,而不在 系统表空间 内。 An important configuration option that affects many aspects of InnoDB file storage, availability of features, and I/O characteristics. In MySQL 5.6.7 and higher, it is enabled by default. The innodb_file_per_table option turns on file-per-table mode. With this mode enabled, a newly created InnoDB table and associated indexes can be stored in a file-per-table .ibd file, outside the system tablespace.

此选项会影响多条 SQL 语句(例如 DROP TABLE 和 TRUNCATE TABLE)的性能和存储考虑。This option affects the performance and storage considerations for a number of SQL statements, such as DROP TABLE and TRUNCATE TABLE.

启用 innodb_file_per_table 选项可以让您利用诸如表 压缩 和 MySQL 企业备份 中的命名表备份等功能。Enabling the innodb_file_per_table option allows you to take advantage of features such as table compression and named-table backups in MySQL Enterprise Backup.

有关更多信息,请参阅 innodb_file_per_table,以及 第 17.6.3.2 节,“文件按表表空间”。For more information, see innodb_file_per_table, and Section 17.6.3.2, “File-Per-Table Tablespaces”.

另请参阅 压缩,文件按表,.ibd 文件,MySQL 企业备份,系统表空间。See Also compression, file-per-table, .ibd file, MySQL Enterprise Backup, system tablespace.

innodb_lock_wait_timeout

该innodb_lock_wait_timeout option sets the balance between waiting for shared resources to become available, or giving up and handling the error, retrying, or doing alternative processing in your application. Rolls back any InnoDB transaction that waits more than a specified time to acquire a lock. Especially useful if deadlocks are caused by updates to multiple tables controlled by different storage engines; such deadlocks are not detected automatically. The innodb_lock_wait_timeout option sets the balance between waiting for shared resources to become available, or giving up and handling the error, retrying, or doing alternative processing in your application. Rolls back any InnoDB transaction that waits more than a specified time to acquire a lock. Especially useful if deadlocks are caused by updates to multiple tables controlled by different storage engines; such deadlocks are not detected automatically.

另请参见 死锁、死锁检测、锁、等待。See Also deadlock, deadlock detection, lock, wait.

innodb_strict_mode

innodb_strict_mode 选项控制 InnoDB 是否在 严格模式 下运行,在该模式下,通常被视为警告的情况将导致错误(并且底层语句失败)。 The innodb_strict_mode option controls whether InnoDB operates in strict mode, where conditions that are normally treated as warnings, cause errors instead (and the underlying statements fail).

另请参见 严格模式。See Also strict mode.

创新系列Innovation Series

具有相同主要版本的创新发布组成一个创新系列。例如,MySQL 8.1 到 8.3 组成 MySQL 8 创新系列。 Innovation releases with the same major version form an Innovation series. For example, MySQL 8.1 through 8.3 form the MySQL 8 Innovation series.

另请参见 LTS 系列。See Also LTS Series.

插入insert

在 SQL 中,DML 操作之一。插入性能是向表中加载数百万行的 数据仓库 系统以及在任意顺序下有许多并发连接可能插入同一表的 OLTP 系统中的关键因素。如果插入性能对你很重要,你应该了解 InnoDB 的功能,例如在 更改缓冲 中使用的 插入缓冲 以及 自增列。 One of the primary DML operations in SQL. The performance of inserts is a key factor in data warehouse systems that load millions of rows into tables, and OLTP systems where many concurrent connections might insert rows into the same table, in arbitrary order. If insert performance is important to you, you should learn about InnoDB features such as the insert buffer used in change buffering, and auto-increment columns.

另请参见 自动递增、更改缓冲、数据仓库、DML、InnoDB、插入缓冲、OLTP、SQL。See Also auto-increment, change buffering, data warehouse, DML, InnoDB, insert buffer, OLTP, SQL.

插入缓冲insert buffer

以前的 更改缓冲区 名称。在 MySQL 5.5 中,增加了对二级索引页更改进行缓冲的支持,用于 DELETE 和 UPDATE 操作。之前,只有 INSERT 操作引起的更改会被缓冲。现在首选的术语是 更改缓冲区。 The former name of the change buffer. In MySQL 5.5, support was added for buffering changes to secondary index pages for DELETE and UPDATE operations. Previously, only changes resulting from INSERT operations were buffered. The preferred term is now change buffer.

另见 更改缓冲区,更改缓冲。See Also change buffer, change buffering.

插入缓冲insert buffering

将因 INSERT 操作而产生的二级索引页的更改存储在 变更缓冲区 中,而不是立即写入更改,从而可以以最小化随机 I/O 的方式执行物理写入。这是一种 变更缓冲 类型;其他类型是 删除缓冲 和 清除缓冲。 The technique of storing changes to secondary index pages, resulting from INSERT operations, in the change buffer rather than writing the changes immediately, so that the physical writes can be performed to minimize random I/O. It is one of the types of change buffering; the others are delete buffering and purge buffering.

如果二级索引是 唯一的,则不使用插入缓冲,因为在写出新条目之前无法验证新值的唯一性。其他类型的变更缓冲可以用于唯一索引。Insert buffering is not used if the secondary index is unique, because the uniqueness of new values cannot be verified before the new entries are written out. Other kinds of change buffering do work for unique indexes.

另请参见 更改缓冲区, 更改缓冲, 删除缓冲, 插入缓冲区, 清除缓冲, 唯一索引。See Also change buffer, change buffering, delete buffering, insert buffer, purge buffering, unique index.

插入意向锁insert intention lock

一种由 INSERT 操作在行插入之前设置的 间隙锁 类型。这种类型的 锁 表明插入意图,这样多个事务在同一个索引间隙中插入时,如果它们不是在间隙的相同位置插入,就不必互相等待。更多信息,请参见 第 17.7.1 节,“InnoDB 锁定”。 A type of gap lock that is set by INSERT operations prior to row insertion. This type of lock signals the intent to insert in such a way that multiple transactions inserting into the same index gap need not wait for each other if they are not inserting at the same position within the gap. For more information, see Section 17.7.1, “InnoDB Locking”.

另请参见 间隙锁、锁、下一个键锁。See Also gap lock, lock, next-key lock.

实例instance

一个单独的 mysqld 守护进程管理一个 数据目录,该目录表示一个或多个 数据库 及其一组 表。在开发、测试以及某些 复制 场景中,在同一台 服务器 上运行多个实例是很常见的,每个实例管理自己的数据目录,并监听自己的端口或套接字。在一个实例运行 基于磁盘的 工作负载时,服务器可能仍有额外的 CPU 和内存容量来运行其他实例。 A single mysqld daemon managing a data directory representing one or more databases with a set of tables. It is common in development, testing, and some replication scenarios to have multiple instances on the same server machine, each managing its own data directory and listening on its own port or socket. With one instance running a disk-bound workload, the server might still have extra CPU and memory capacity to run additional instances.

另请参阅 数据目录,数据库,磁盘绑定,mysqld,复制,服务器,表。See Also data directory, database, disk-bound, mysqld, replication, server, table.

工具化instrumentation

在源代码级别进行修改以收集性能数据用于调优和调试。在 MySQL 中,通过 INFORMATION_SCHEMA 和 PERFORMANCE_SCHEMA 数据库,工具化收集的数据可以通过 SQL 接口访问。 Modifications at the source code level to collect performance data for tuning and debugging. In MySQL, data collected by instrumentation is exposed through an SQL interface using the INFORMATION_SCHEMA and PERFORMANCE_SCHEMA databases.

另请参见 INFORMATION_SCHEMA,性能模式。See Also INFORMATION_SCHEMA, Performance Schema.

意向独占锁intention exclusive lock

参见 意向锁。See intention lock.

意向锁intention lock

一种应用于表的锁,用于指示事务打算在表中的行上获取的锁类型。不同的事务可以在同一张表上获取不同类型的意图锁,但第一个在表上获取意图排他 (IX) 锁的事务会阻止其他事务在该表上获取任何 S 或 X 锁。相反,第一个在表上获取意图共享 (IS) 锁的事务会阻止其他事务在该表上获取任何 X 锁。两阶段过程允许按顺序解决锁请求,而不会阻塞兼容的锁和相应的操作。有关此锁定机制的更多信息,请参阅 第 17.7.1 节,“InnoDB 锁定”。 A kind of lock that applies to the table, used to indicate the kind of lock the transaction intends to acquire on rows in the table. Different transactions can acquire different kinds of intention locks on the same table, but the first transaction to acquire an intention exclusive (IX) lock on a table prevents other transactions from acquiring any S or X locks on the table. Conversely, the first transaction to acquire an intention shared (IS) lock on a table prevents other transactions from acquiring any X locks on the table. The two-phase process allows the lock requests to be resolved in order, without blocking locks and corresponding operations that are compatible. For more information about this locking mechanism, see Section 17.7.1, “InnoDB Locking”.

另见 锁,锁模式,加锁,事务。See Also lock, lock mode, locking, transaction.

意向共享锁intention shared lock

参见 意向锁。See intention lock.

拦截器interceptor

用于对应用程序的某些方面进行检测或调试的代码,可以在不重新编译或更改应用程序源代码的情况下启用。 Code for instrumenting or debugging some aspect of an application, which can be enabled without recompiling or changing the source of the application itself.

另见 命令拦截器、Connector/J、Connector/NET、异常拦截器。See Also command interceptor, Connector/J, Connector/NET, exception interceptor.

内置临时表intrinsic temporary table

由优化器使用的优化内部InnoDB临时表。 An optimized internal InnoDB temporary table used by the optimizer.

另见 优化器。See Also optimizer.

倒排索引inverted index

一种针对文档检索系统优化的数据结构,用于实现 InnoDB 全文搜索。InnoDB FULLTEXT 索引,作为倒排索引实现,记录每个单词在文档中的位置,而不是表行的位置。单个列的值(以文本字符串存储的文档)在倒排索引中由多个条目表示。 A data structure optimized for document retrieval systems, used in the implementation of InnoDB full-text search. The InnoDB FULLTEXT index, implemented as an inverted index, records the position of each word within a document, rather than the location of a table row. A single column value (a document stored as a text string) is represented by many entries in the inverted index.

另请参见 全文搜索,FULLTEXT 索引,ilist。See Also full-text search, FULLTEXT index, ilist.

IOPS

Acronym for I/O operations per second. A common measurement for busy systems, particularly OLTP applications. If this value is near the maximum that the storage devices can handle, the application can become disk-bound, limiting scalability.

另请参见 受磁盘限制、OLTP、可扩展性。See Also disk-bound, OLTP, scalability.

隔离级别isolation level

数据库处理的基础之一。隔离是缩写 ACID 中的 I;隔离级别是用来在多个 事务 同时进行更改和查询时,微调性能与可靠性、一致性以及结果可重复性之间平衡的设置。 One of the foundations of database processing. Isolation is the I in the acronym ACID; the isolation level is the setting that fine-tunes the balance between performance and reliability, consistency, and reproducibility of results when multiple transactions are making changes and performing queries at the same time.

从最高的一致性和保护到最低,InnoDB 支持的隔离级别为:SERIALIZABLE、REPEATABLE READ、READ COMMITTED 和 READ UNCOMMITTED。From highest amount of consistency and protection to the least, the isolation levels supported by InnoDB are: SERIALIZABLE, REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED.

对于 InnoDB 表,许多用户可以在所有操作中保持默认的隔离级别(可重复读)。高级用户可能会选择 提交读 级别,因为他们在 OLTP 处理方面推动可扩展性的极限,或者在数据仓库操作中,当小的差异不会影响大数据量的汇总结果时也会使用该级别。边缘级别(可串行化 和 未提交读)会改变处理行为到如此程度,以至于很少被使用。With InnoDB tables, many users can keep the default isolation level (REPEATABLE READ) for all operations. Expert users might choose the READ COMMITTED level as they push the boundaries of scalability with OLTP processing, or during data warehousing operations where minor inconsistencies do not affect the aggregate results of large amounts of data. The levels on the edges (SERIALIZABLE and READ UNCOMMITTED) change the processing behavior to such an extent that they are rarely used.

另见 ACID、OLTP、已提交读、未提交读、可重复读、可序列化、事务。See Also ACID, OLTP, READ COMMITTED, READ UNCOMMITTED, REPEATABLE READ, SERIALIZABLE, transaction.

JJ

J2EE

Java 平台,企业版:Oracle 的企业级 Java 平台。它由用于企业级 Java 应用程序的 API 和运行环境组成。有关完整详情,请参见 http://www.oracle.com/technetwork/java/javaee/overview/index.html。对于 MySQL 应用程序,通常使用 Connector/J 进行数据库访问,并使用如 Tomcat 或 JBoss 的应用服务器来处理中间层工作,并可选择使用如 Spring 的框架。J2EE 堆栈中通常提供的数据库相关功能包括 连接池 和 故障切换 支持。 Java Platform, Enterprise Edition: Oracle's enterprise Java platform. It consists of an API and a runtime environment for enterprise-class Java applications. For full details, see http://www.oracle.com/technetwork/java/javaee/overview/index.html. With MySQL applications, you typically use Connector/J for database access, and an application server such as Tomcat or JBoss to handle the middle-tier work, and optionally a framework such as Spring. Database-related features often offered within a J2EE stack include a connection pool and failover support.

另请参见 连接池、Connector/J、故障切换、Java、JBoss、Spring、Tomcat。See Also connection pool, Connector/J, failover, Java, JBoss, Spring, Tomcat.

Java

一种结合了高性能、丰富的内置功能和数据类型、面向对象机制、广泛的标准库以及大量可重用第三方模块的编程语言。企业开发由许多框架、应用服务器和其他技术支持。它的大部分语法对 C 和 C 开发者来说非常熟悉。要使用 MySQL 编写 Java 应用程序,可以使用名为 Connector/J 的 JDBC 驱动程序。 A programming language combining high performance, rich built-in features and data types, object-oriented mechanisms, extensive standard library, and wide range of reusable third-party modules. Enterprise development is supported by many frameworks, application servers, and other technologies. Much of its syntax is familiar to C and C++ developers. To write Java applications with MySQL, you use the JDBC driver known as Connector/J.

另请参见 C、Connector/J、C 、JDBC。See Also C, Connector/J, C++, JDBC.

JBoss

参见 J2EE。See Also J2EE.

JDBC

缩写为“Java 数据库连接”,是一个用于从Java应用程序访问数据库的API。编写 MySQL 应用程序的 Java 开发人员使用Connector/J组件作为他们的 JDBC 驱动程序。 Abbreviation for “Java Database Connectivity”, an API for database access from Java applications. Java developers writing MySQL applications use the Connector/J component as their JDBC driver.

另见 API、Connector/J、J2EE、Java。See Also API, Connector/J, J2EE, Java.

JNDI

另请参见 Java。See Also Java.

join

一个 查询,通过引用在表中具有相同值的列,从多个表中检索数据。理想情况下,这些列是 InnoDB 外键 关系的一部分,这确保了 参照完整性 并且连接列是 已建立索引 的。经常用于通过在 规范化 数据设计中将重复的字符串替换为数字 ID 来节省空间并提高查询性能。 A query that retrieves data from more than one table, by referencing columns in the tables that hold identical values. Ideally, these columns are part of an InnoDB foreign key relationship, which ensures referential integrity and that the join columns are indexed. Often used to save space and improve query performance by replacing repeated strings with numeric IDs, in a normalized data design.

另请参见 外键、索引、规范化、查询、参照完整性。See Also foreign key, index, normalized, query, referential integrity.

KK

KDC

参见 密钥分发中心。See key distribution center.

密钥分发中心key distribution center

在 Kerberos 中,密钥分发中心包括一个认证服务器(AS)和一个票证授予服务器(TGS)。 In Kerberos, the key distribution center comprises an authentication server (AS) and a ticket-granting server (TGS).

另请参见 认证服务器,票据授予票。See Also authentication server, ticket-granting ticket.

密钥库keystore

另请参见 SSL。See Also SSL.

KEY_BLOCK_SIZE

一个选项,用于指定使用 压缩行格式 的 InnoDB 表中数据页的大小。默认值为 8 千字节。较低的值有可能触及依赖于行大小和压缩比例组合的内部限制。 An option to specify the size of data pages within an InnoDB table that uses compressed row format. The default is 8 kilobytes. Lower values risk hitting internal limits that depend on the combination of row size and compression percentage.

对于 MyISAM 表,KEY_BLOCK_SIZE 可选地指定用于索引键块的字节大小。该值被视为提示;如有必要,可以使用不同的大小。为单个索引定义指定的 KEY_BLOCK_SIZE 值会覆盖表级的 KEY_BLOCK_SIZE 值。For MyISAM tables, KEY_BLOCK_SIZE optionally specifies the size in bytes to use for index key blocks. The value is treated as a hint; a different size could be used if necessary. A KEY_BLOCK_SIZE value specified for an individual index definition overrides a table-level KEY_BLOCK_SIZE value.

另请参见 压缩行格式。See Also compressed row format.

LL

闩锁latch

InnoDB 用来实现自身内部内存结构 锁 的轻量级结构,通常保持时间很短,以毫秒或微秒计。一个通用术语,包括 互斥锁(用于独占访问)和 读写锁(用于共享访问)。某些闩锁是 InnoDB 性能调优的重点。通过 性能模式 接口可以获取关于闩锁使用和争用的统计信息。 A lightweight structure used by InnoDB to implement a lock for its own internal memory structures, typically held for a brief time measured in milliseconds or microseconds. A general term that includes both mutexes (for exclusive access) and rw-locks (for shared access). Certain latches are the focus of InnoDB performance tuning. Statistics about latch use and contention are available through the Performance Schema interface.

另请参阅 锁、加锁、互斥量、性能模式、读写锁。See Also lock, locking, mutex, Performance Schema, rw-lock.

libmysql

非正式名称,指 libmysqlclient 库。 Informal name for the libmysqlclient library.

另请参阅 libmysqlclient。See Also libmysqlclient.

libmysqlclient

这个名为 libmysqlclient.a 或 libmysqlclient.so 的库文件,通常被链接到用 C 编写的 客户端 程序中。有时非正式地称为 libmysql 或 mysqlclient 库。 The library file, named libmysqlclient.a or libmysqlclient.so, that is typically linked into client programs written in C. Sometimes known informally as libmysql or the mysqlclient library.

另请参见 客户端、libmysql、mysqlclient。See Also client, libmysql, mysqlclient.

libmysqld

这个 嵌入式 MySQL 服务器库可以让你在一个 客户端 应用程序中运行一个功能完整的 MySQL 服务器。主要优点是提高速度并简化嵌入式应用程序的管理。你链接的是 libmysqld 库,而不是 libmysqlclient。这三种库的 API 是相同的。 This embedded MySQL server library makes it possible to run a full-featured MySQL server inside a client application. The main benefits are increased speed and more simple management for embedded applications. You link with the libmysqld library rather than libmysqlclient. The API is identical between all three of these libraries.

另请参见 客户端,嵌入式,libmysql,libmysqlclient。See Also client, embedded, libmysql, libmysqlclient.

生命周期拦截器lifecycle interceptor

一种由 Connector/J 支持的 拦截器。它涉及实现接口 com.mysql.jdbc.ConnectionLifecycleInterceptor。 A type of interceptor supported by Connector/J. It involves implementing the interface com.mysql.jdbc.ConnectionLifecycleInterceptor.

另请参见 Connector/J,拦截器。See Also Connector/J, interceptor.

列表list

InnoDB 缓冲池 表示为一系列内存 页 的列表。随着新页被访问并进入缓冲池,缓冲池中的页再次被访问并被认为是更新的,以及长时间未被访问的页从缓冲池中被 替换,该列表会重新排序。缓冲池被划分为 子列表,其替换策略是熟悉的 LRU 技术的一种变体。 The InnoDB buffer pool is represented as a list of memory pages. The list is reordered as new pages are accessed and enter the buffer pool, as pages within the buffer pool are accessed again and are considered newer, and as pages that are not accessed for a long time are evicted from the buffer pool. The buffer pool is divided into sublists, and the replacement policy is a variation of the familiar LRU technique.

另请参见 缓冲池、驱逐、LRU、页、子列表。See Also buffer pool, eviction, LRU, page, sublist.

负载均衡load balancing

一种通过将查询请求发送到复制或集群配置中的不同从服务器来扩展只读连接的技术。在 Connector/J 中,负载均衡通过 com.mysql.jdbc.ReplicationDriver 类启用,并由配置属性 loadBalanceStrategy 控制。 A technique for scaling read-only connections by sending query requests to different slave servers in a replication or Cluster configuration. With Connector/J, load balancing is enabled through the com.mysql.jdbc.ReplicationDriver class and controlled by the configuration property loadBalanceStrategy.

另见 Connector/J, J2EE。See Also Connector/J, J2EE.

localhost 本地主机localhost

另见 连接。See Also connection.

锁lock

一个高层次的概念对象,用于控制对资源(如表、行或内部数据结构)的访问,作为 锁定 策略的一部分。对于高强度的性能调优,你可能会深入研究实现锁的实际结构,例如 互斥量 和 闩锁。 The high-level notion of an object that controls access to a resource, such as a table, row, or internal data structure, as part of a locking strategy. For intensive performance tuning, you might delve into the actual structures that implement locks, such as mutexes and latches.

参见 锁存器、锁模式、锁定、互斥量。See Also latch, lock mode, locking, mutex.

锁升级lock escalation

一些数据库系统中使用的一种操作,它将多个 行锁 转换为单个 表锁,从而节省内存空间,但同时减少对表的并发访问。InnoDB 使用了一种节省空间的行锁表示方式,因此不需要 锁 升级。 An operation used in some database systems that converts many row locks into a single table lock, saving memory space but reducing concurrent access to the table. InnoDB uses a space-efficient representation for row locks, so that lock escalation is not needed.

另请参见 锁定、行锁、表锁。See Also locking, row lock, table lock.

锁模式lock mode

共享(S)锁允许事务读取一行。同一行可以被多个事务同时获取 S 锁。 A shared (S) lock allows a transaction to read a row. Multiple transactions can acquire an S lock on that same row at the same time.

独占(X)锁允许事务更新或删除一行。其他事务不能在同一时间获取该行的任何类型的锁。An exclusive (X) lock allows a transaction to update or delete a row. No other transaction can acquire any kind of lock on that same row at the same time.

意向锁 适用于表,用于表示事务打算在表中的行上获取哪种类型的锁。不同的事务可以在同一张表上获取不同类型的意向锁,但第一个在表上获取意向独占(IX)锁的事务会阻止其他事务在该表上获取任何 S 或 X 锁。相反,第一个在表上获取意向共享(IS)锁的事务会阻止其他事务在该表上获取任何 X 锁。这一两阶段过程允许锁请求按顺序解决,而不会阻塞兼容的锁及相应操作。Intention locks apply to the table, and are used to indicate what kind of lock the transaction intends to acquire on rows in the table. Different transactions can acquire different kinds of intention locks on the same table, but the first transaction to acquire an intention exclusive (IX) lock on a table prevents other transactions from acquiring any S or X locks on the table. Conversely, the first transaction to acquire an intention shared (IS) lock on a table prevents other transactions from acquiring any X locks on the table. The two-phase process allows the lock requests to be resolved in order, without blocking locks and corresponding operations that are compatible.

另请参见 意向锁、锁、加锁、事务。See Also intention lock, lock, locking, transaction.

加锁locking

保护一个 事务 不被其他事务正在查询或更改的数据看到或更改的系统。锁定 策略必须在数据库操作的可靠性和一致性(ACID 原则)与良好 并发性 所需的性能之间取得平衡。微调锁定策略通常涉及选择一个 隔离级别,并确保所有数据库操作对于该隔离级别都是安全可靠的。 The system of protecting a transaction from seeing or changing data that is being queried or changed by other transactions. The locking strategy must balance reliability and consistency of database operations (the principles of the ACID philosophy) against the performance needed for good concurrency. Fine-tuning the locking strategy often involves choosing an isolation level and ensuring all your database operations are safe and reliable for that isolation level.

参见 ACID、并发、隔离级别、锁定、事务。See Also ACID, concurrency, isolation level, locking, transaction.

锁定读取locking read

一个 SELECT 语句,同时在 InnoDB 表上执行 锁定 操作。可以是 SELECT ... FOR UPDATE 或 SELECT ... LOCK IN SHARE MODE。根据事务的 隔离级别,可能会产生 死锁。与 非锁定读取 相反。在 只读事务 中不允许对全局表使用。 A SELECT statement that also performs a locking operation on an InnoDB table. Either SELECT ... FOR UPDATE or SELECT ... LOCK IN SHARE MODE. It has the potential to produce a deadlock, depending on the isolation level of the transaction. The opposite of a non-locking read. Not allowed for global tables in a read-only transaction.

SELECT ... FOR SHARE 在 MySQL 8.0.1 中取代了 SELECT ... LOCK IN SHARE MODE,但 LOCK IN SHARE MODE 仍可用于向后兼容。SELECT ... FOR SHARE replaces SELECT ... LOCK IN SHARE MODE in MySQL 8.0.1, but LOCK IN SHARE MODE remains available for backward compatibility.

参见 第 17.7.2.4 节,“锁定读取”。See Section 17.7.2.4, “Locking Reads”.

另请参阅 死锁、隔离级别、加锁、非锁定读取、只读事务。See Also deadlock, isolation level, locking, non-locking read, read-only transaction.

日志log

在 InnoDB 环境中,“日志” 或 “日志文件” 通常指由 ib_logfileN 文件表示的 重做日志。另一种类型的 InnoDB 日志是 回滚日志,它是一个存储区域,用于保存活跃事务修改数据的副本。 In the InnoDB context, “log” or “log files” typically refers to the redo log represented by the ib_logfileN files. Another type of InnoDB log is the undo log, which is a storage area that holds copies of data modified by active transactions.

MySQL 中其他重要的日志包括 错误日志(用于诊断启动和运行时问题)、二进制日志(用于处理复制和执行时间点恢复)、通用查询日志(用于诊断应用程序问题)以及 慢查询日志(用于诊断性能问题)。Other kinds of logs that are important in MySQL are the error log (for diagnosing startup and runtime problems), binary log (for working with replication and performing point-in-time restores), the general query log (for diagnosing application problems), and the slow query log (for diagnosing performance problems).

另请参见 二进制日志,错误日志,通用查询日志,ib_logfile,重做日志,慢查询日志,回滚日志。See Also binary log, error log, general query log, ib_logfile, redo log, slow query log, undo log.

日志缓冲区log buffer

存放将要写入组成 重做日志 的 日志文件 的数据的内存区域。它由 innodb_log_buffer_size 配置选项控制。 The memory area that holds data to be written to the log files that make up the redo log. It is controlled by the innodb_log_buffer_size configuration option.

另请参见 日志文件,重做日志。See Also log file, redo log.

日志文件log file

构成 重做日志 的 ib_logfileN 文件之一。数据从 日志缓冲区 内存区域写入这些文件。 One of the ib_logfileN files that make up the redo log. Data is written to these files from the log buffer memory area.

另请参见 ib_logfile,日志缓冲区,重做日志。See Also ib_logfile, log buffer, redo log.

日志组log group

构成 重做日志 的文件集合,通常命名为 ib_logfile0 和 ib_logfile1。(因此,有时统称为 ib_logfile。) The set of files that make up the redo log, typically named ib_logfile0 and ib_logfile1. (For that reason, sometimes referred to collectively as ib_logfile.)

另请参见 ib_logfile,重做日志。See Also ib_logfile, redo log.

逻辑logical

一种操作类型,涉及高级、抽象的方面,如表、查询、索引及其他 SQL 概念。通常,逻辑方面对于使数据库管理和应用开发方便易用非常重要。与 物理 相对。 A type of operation that involves high-level, abstract aspects such as tables, queries, indexes, and other SQL concepts. Typically, logical aspects are important to make database administration and application development convenient and usable. Contrast with physical.

参见 逻辑备份, 物理。See Also logical backup, physical.

逻辑备份logical backup

一种 备份,它复制表结构和数据,但不复制实际的数据文件。例如,mysqldump 命令生成的是逻辑备份,因为其输出包含诸如 CREATE TABLE 和 INSERT 的语句,可以重新创建数据。与 物理备份 相比,逻辑备份提供了灵活性(例如,可以在恢复之前编辑表定义或插入语句),但 恢复 所需时间可能远长于物理备份。 A backup that reproduces table structure and data, without copying the actual data files. For example, the mysqldump command produces a logical backup, because its output contains statements such as CREATE TABLE and INSERT that can re-create the data. Contrast with physical backup. A logical backup offers flexibility (for example, you could edit table definitions or insert statements before restoring), but can take substantially longer to restore than a physical backup.

参见 备份, mysqldump, 物理备份, 恢复。See Also backup, mysqldump, physical backup, restore.

loose_

一个前缀,添加到服务器启动后的 InnoDB 配置选项中,因此任何当前 MySQL 版本不识别的新配置选项都不会导致启动失败。MySQL 会处理以此前缀开头的配置选项,但如果前缀之后的部分不是一个被识别的选项,则会给出警告而不是失败。 A prefix added to InnoDB configuration options after server startup, so any new configuration options not recognized by the current level of MySQL do not cause a startup failure. MySQL processes configuration options that start with this prefix, but gives a warning rather than a failure if the part after the prefix is not a recognized option.

参见 启动。See Also startup.

低水位标记low-water mark

表示下限的一个值,通常是某种纠正措施开始或加剧的阈值。与 高水位标记 形成对比。 A value representing a lower limit, typically a threshold value at which some corrective action begins or becomes more aggressive. Contrast with high-water mark.

另见 高水位标记。See Also high-water mark.

LRU(最近最少使用)LRU

An acronym for “least recently used”, a common method for managing storage areas. The items that have not been used recently are 页数 when space is needed to cache newer items. InnoDB uses the LRU mechanism by default to manage the 预读 within the 缓冲池, but makes exceptions in cases where a page might be read only a single time, such as during a full table scan. This variation of the LRU algorithm is called the midpoint insertion strategy. For more information, see Section 17.5.1, “Buffer Pool”. An acronym for “least recently used”, a common method for managing storage areas. The items that have not been used recently are evicted when space is needed to cache newer items. InnoDB uses the LRU mechanism by default to manage the pages within the buffer pool, but makes exceptions in cases where a page might be read only a single time, such as during a full table scan. This variation of the LRU algorithm is called the midpoint insertion strategy. For more information, see Section 17.5.1, “Buffer Pool”.

另请参见 缓冲池、逐出、全表扫描、中点插入策略、页。See Also buffer pool, eviction, full table scan, midpoint insertion strategy, page.

LSN

缩写,表示“日志序列号”。这个任意的、持续递增的值表示与记录在重做日志中的操作对应的时间点。(这个时间点不考虑事务边界;它可以出现在一个或多个事务的中间。)它由InnoDB在崩溃恢复期间以及管理缓冲池时内部使用。 Acronym for “log sequence number”. This arbitrary, ever-increasing value represents a point in time corresponding to operations recorded in the redo log. (This point in time is regardless of transaction boundaries; it can fall in the middle of one or more transactions.) It is used internally by InnoDB during crash recovery and for managing the buffer pool.

在 MySQL 5.6.3 之前,LSN 是一个 4 字节无符号整数。在 MySQL 5.6.3 中,当 redo 日志文件大小限制从 4GB 增加到 512GB 时,LSN 变为 8 字节无符号整数,因为需要额外的字节来存储额外的大小信息。在 MySQL 5.6.3 或更高版本上构建的使用 LSN 值的应用程序,应使用 64 位而不是 32 位变量来存储和比较 LSN 值。Prior to MySQL 5.6.3, the LSN was a 4-byte unsigned integer. The LSN became an 8-byte unsigned integer in MySQL 5.6.3 when the redo log file size limit increased from 4GB to 512GB, as additional bytes were required to store extra size information. Applications built on MySQL 5.6.3 or later that use LSN values should use 64-bit rather than 32-bit variables to store and compare LSN values.

在 MySQL Enterprise Backup 产品中,您可以指定一个 LSN 来表示进行 增量备份 的时间点。相关的 LSN 会显示在 mysqlbackup 命令的输出中。一旦您获得了与完整备份时间对应的 LSN,就可以指定该值来进行后续的增量备份,其输出包含下一个增量备份的另一个 LSN。In the MySQL Enterprise Backup product, you can specify an LSN to represent the point in time from which to take an incremental backup. The relevant LSN is displayed by the output of the mysqlbackup command. Once you have the LSN corresponding to the time of a full backup, you can specify that value to take a subsequent incremental backup, whose output contains another LSN for the next incremental backup.

另见 缓冲池,崩溃恢复,增量备份,MySQL 企业备份,重做日志,事务。See Also buffer pool, crash recovery, incremental backup, MySQL Enterprise Backup, redo log, transaction.

LTS 系列LTS Series

具有相同主版本号的 LTS 版本构成一个 LTS 系列。例如,所有 MySQL 8.4.x 版本构成 MySQL 8.4 LTS 系列。 LTS releases with the same major version number form an LTS series. For example, all MySQL 8.4.x releases form the MySQL 8.4 LTS series.

注意:MySQL 8.0 是 LTS 发布模型之前的一个修复程序系列。Note: MySQL 8.0 is a Bugfix series that preceded the LTS release model.

参见 创新系列。See Also Innovation Series.

MM

.MRG 文件.MRG file

一个包含对其他表引用的文件,由 MERGE 存储引擎使用。此扩展名的文件总是包含在 mysqlbackup 命令生成的备份中,该命令属于 MySQL 企业版备份 产品。 A file containing references to other tables, used by the MERGE storage engine. Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product.

参见 MySQL 企业版备份,mysqlbackup 命令。See Also MySQL Enterprise Backup, mysqlbackup command.

.MYD 文件.MYD file

MySQL 用于存储 MyISAM 表数据的文件。 A file that MySQL uses to store data for a MyISAM table.

另请参见 .MYI 文件,MySQL 企业备份,mysqlbackup 命令。See Also .MYI file, MySQL Enterprise Backup, mysqlbackup command.

.MYI 文件.MYI file

MySQL 用于存储 MyISAM 表索引的文件。 A file that MySQL uses to store indexes for a MyISAM table.

另请参见 .MYD 文件,MySQL 企业备份,mysqlbackup 命令。See Also .MYD file, MySQL Enterprise Backup, mysqlbackup command.

主服务器master

参见 源。See source.

主线程master thread

一个 InnoDB 线程,在后台执行各种任务。这些任务大多数与 I/O 相关,例如将 修改缓冲区 的更改写入相应的辅助索引。 An InnoDB thread that performs various tasks in the background. Most of these tasks are I/O related, such as writing changes from the change buffer to the appropriate secondary indexes.

为了提高并发性,有时会将操作从主线程移到单独的后台线程。例如,在 MySQL 5.6 及更高版本中,脏页由页面清理器线程而不是主线程从缓冲池中刷新。To improve concurrency, sometimes actions are moved from the master thread to separate background threads. For example, in MySQL 5.6 and higher, dirty pages are flushed from the buffer pool by the page cleaner thread rather than the master thread.

另请参见 缓冲池,变更缓冲,并发,脏页,刷新,页面清理器,线程。See Also buffer pool, change buffer, concurrency, dirty page, flush, page cleaner, thread.

MDL

缩写自 “元数据锁”。 Acronym for “metadata lock”.

另请参见 元数据锁。See Also metadata lock.

中级信任medium trust

部分信任 的同义词。由于信任设置的范围非常广泛,“部分信任” 更为常用,以避免暗示只有三个级别(低、中和完全)。 Synonym for partial trust. Because the range of trust settings is so broad, “partial trust” is preferred, to avoid the implication that there are only three levels (low, medium, and full).

另请参见 Connector/NET、部分信任。See Also Connector/NET, partial trust.

memcached

MySQL 和 NoSQL 软件栈中常见的组件之一,允许对单个值进行高速读写,并将结果完全缓存于内存中。传统上,应用程序需要额外逻辑将相同的数据写入 MySQL 数据库以进行永久存储,或者当数据尚未缓存到内存中时,从 MySQL 数据库读取数据。现在,应用程序可以使用简单的 memcached 协议,该协议得到多种语言客户端库的支持,直接与使用 NDB 表的 MySQL 服务器通信。这些 MySQL 表的 NoSQL 接口允许应用程序比直接发出 SQL 语句实现更高的读写性能,并且可以简化已经在系统中采用 memcached 进行内存缓存的应用程序逻辑和部署配置。 A popular component of many MySQL and NoSQL software stacks, allowing fast reads and writes for single values and caching the results entirely in memory. Traditionally, applications required extra logic to write the same data to a MySQL database for permanent storage, or to read data from a MySQL database when it was not cached yet in memory. Now, applications can use the simple memcached protocol, supported by client libraries for many languages, to communicate directly with MySQL servers using NDB tables. These NoSQL interfaces to MySQL tables allow applications to achieve higher read and write performance than by issuing SQL statements directly, and can simplify application logic and deployment configurations for systems that already incorporate memcached for in-memory caching.

另请参见 NoSQL。See Also NoSQL.

合并merge

将缓存在内存中的数据应用更改,例如当页面被加载到 缓冲池 时,将 变更缓冲区 中记录的任何适用更改合并到缓冲池中的页面中。更新的数据最终通过 刷新 机制写入 表空间。 To apply changes to data cached in memory, such as when a page is brought into the buffer pool, and any applicable changes recorded in the change buffer are incorporated into the page in the buffer pool. The updated data is eventually written to the tablespace by the flush mechanism.

另请参见 缓冲池、更改缓冲、刷新、表空间。See Also buffer pool, change buffer, flush, tablespace.

元数据锁metadata lock

一种 锁 类型,可防止对同时被另一个 事务 使用的表执行 DDL 操作。详情请参见 第 10.11.4 节,“元数据锁定”。 A type of lock that prevents DDL operations on a table that is being used at the same time by another transaction. For details, see Section 10.11.4, “Metadata Locking”.

对在线操作的增强,特别是在 MySQL 5.6 及更高版本中,主要集中在减少元数据锁定的数量。其目标是,使那些不更改表结构的 DDL 操作(例如 CREATE INDEX 和 DROP INDEX 针对 InnoDB 表)可以在其他事务对表进行查询、更新等操作时继续进行。Enhancements to online operations, particularly in MySQL 5.6 and higher, are focused on reducing the amount of metadata locking. The objective is for DDL operations that do not change the table structure (such as CREATE INDEX and DROP INDEX for InnoDB tables) to proceed while the table is being queried, updated, and so on by other transactions.

另请参阅 DDL、锁、在线、事务。See Also DDL, lock, online, transaction.

指标计数器metrics counter

这是由 INNODB_METRICS 表在 INFORMATION_SCHEMA 中实现的功能,从 MySQL 5.6 及更高版本开始支持。您可以查询低级 InnoDB 操作的 计数 和总数,并结合 性能模式 的数据使用这些结果进行性能调优。 A feature implemented by the INNODB_METRICS table in the INFORMATION_SCHEMA, in MySQL 5.6 and higher. You can query counts and totals for low-level InnoDB operations, and use the results for performance tuning in combination with data from the Performance Schema.

另请参见 计数器、INFORMATION_SCHEMA、Performance Schema。See Also counter, INFORMATION_SCHEMA, Performance Schema.

中点插入策略midpoint insertion strategy

技术是在将 页面 初始引入 InnoDB 缓冲池 时,不放在列表的 “最新” 端,而是放在中间的某个位置。该点的具体位置可以根据 innodb_old_blocks_pct 选项的设置而有所不同。目的是让那些只被读取一次的页面,例如在 全表扫描 中,可以比严格的 LRU 算法更快地从缓冲池中淘汰。有关详细信息,请参见 第 17.5.1 节,“缓冲池”。 The technique of initially bringing pages into the InnoDB buffer pool not at the “newest” end of the list, but instead somewhere in the middle. The exact location of this point can vary, based on the setting of the innodb_old_blocks_pct option. The intent is that pages that are only read once, such as during a full table scan, can be aged out of the buffer pool sooner than with a strict LRU algorithm. For more information, see Section 17.5.1, “Buffer Pool”.

另请参见 缓冲池、全表扫描、最近最少使用 (LRU)、页。See Also buffer pool, full table scan, LRU, page.

迷你事务mini-transaction

An internal phase of InnoDB processing, when making changes at the physical level to internal data structures during DML operations. A mini-transaction (mtr) has no notion of rollback; multiple mini-transactions can occur within a single transaction. Mini-transactions write information to the redo log that is used during crash recovery. A mini-transaction can also happen outside the context of a regular transaction, for example during purge processing by background threads.

另请参见 提交、崩溃恢复、DML、物理、清除、重做日志、回滚、事务。See Also commit, crash recovery, DML, physical, purge, redo log, rollback, transaction.

混合模式插入mixed-mode insert

一条 INSERT 语句,其中为部分但不是全部新行指定了 自增 值。例如,多值 INSERT 可以在某些情况下为自增列指定值,而在其他情况下指定 NULL。对于列值被指定为 NULL 的行,InnoDB 会生成自增值。另一个例子是 INSERT ... ON DUPLICATE KEY UPDATE 语句,对于被处理为 UPDATE 而不是 INSERT 的重复行,可能会生成自增值但不会使用。 An INSERT statement where auto-increment values are specified for some but not all of the new rows. For example, a multi-value INSERT could specify a value for the auto-increment column in some cases and NULL in other cases. InnoDB generates auto-increment values for the rows where the column value was specified as NULL. Another example is an INSERT ... ON DUPLICATE KEY UPDATE statement, where auto-increment values might be generated but not used, for any duplicate rows that are processed as UPDATE rather than INSERT statements.

可能在 源 和 副本 服务器的 复制 配置中引起一致性问题。可能需要调整 innodb_autoinc_lock_mode 配置选项的值。Can cause consistency issues between source and replica servers in a replication configuration. Can require adjusting the value of the innodb_autoinc_lock_mode configuration option.

另请参阅 自增、innodb_autoinc_lock_mode、副本、复制、源。See Also auto-increment, innodb_autoinc_lock_mode, replica, replication, source.

MM.MySQL

一个较老的 MySQL JDBC 驱动程序,当它与 MySQL 产品集成时演变为 Connector/J。 An older JDBC driver for MySQL that evolved into Connector/J when it was integrated with the MySQL product.

另请参阅 Connector/J。See Also Connector/J.

Mono

由 Novell 开发的开源框架,可与 Connector/NET 和 C# 应用程序一起在 Linux 平台上使用。 An Open Source framework developed by Novell, that works with Connector/NET and C# applications on Linux platforms.

另请参阅 Connector/NET,C#。See Also Connector/NET, C#.

mtr

参见 mini-transaction。See mini-transaction.

多核multi-core

一种可以利用多线程程序的处理器类型,例如 MySQL 服务器。 A type of processor that can take advantage of multithreaded programs, such as the MySQL server.

多版本并发控制multiversion concurrency control

参见 MVCC。See MVCC.

互斥锁mutex

非正式缩写词,指“互斥变量”。(Mutex 本身是 “互斥” 的缩写。)InnoDB 用来表示和强制对内部内存数据结构进行独占访问 锁 的低级对象。一旦锁被获取,任何其他进程、线程等都无法获取同一锁。与 读写锁 对比,后者 InnoDB 用来表示和强制对内部内存数据结构进行共享访问 锁。互斥锁和读写锁统称为 闩锁。 Informal abbreviation for “mutex variable”. (Mutex itself is short for “mutual exclusion”.) The low-level object that InnoDB uses to represent and enforce exclusive-access locks to internal in-memory data structures. Once the lock is acquired, any other process, thread, and so on is prevented from acquiring the same lock. Contrast with rw-locks, which InnoDB uses to represent and enforce shared-access locks to internal in-memory data structures. Mutexes and rw-locks are known collectively as latches.

另请参阅 闩锁, 锁, 性能模式, Pthreads 线程, 读写锁.See Also latch, lock, Performance Schema, Pthreads, rw-lock.

多版本并发控制 (MVCC)MVCC

Acronym for “multiversion concurrency control”. This technique lets InnoDB 事务 with certain isolation levels perform consistent read operations; that is, to query rows that are being updated by other transactions, and see the values from before those updates occurred. This is a powerful technique to increase concurrency, by allowing queries to proceed without waiting due to locks held by the other transactions. Acronym for “multiversion concurrency control”. This technique lets InnoDB transactions with certain isolation levels perform consistent read operations; that is, to query rows that are being updated by other transactions, and see the values from before those updates occurred. This is a powerful technique to increase concurrency, by allowing queries to proceed without waiting due to locks held by the other transactions.

这种技术在数据库领域并不普遍。一些其他数据库产品,以及一些其他 MySQL 存储引擎,不支持它。This technique is not universal in the database world. Some other database products, and some other MySQL storage engines, do not support it.

另请参见 ACID,并发,一致性读取,隔离级别,锁,事务。See Also ACID, concurrency, consistent read, isolation level, lock, transaction.

my.cnf

在 Unix 或 Linux 系统上,MySQL 选项文件 的名称。 The name, on Unix or Linux systems, of the MySQL option file.

另请参见 my.ini,选项文件。See Also my.ini, option file.

my.ini

在 Windows 系统上,MySQL 选项文件 的名称。 The name, on Windows systems, of the MySQL option file.

另见 my.cnf,选项文件。See Also my.cnf, option file.

MyODBC 驱动程序MyODBC drivers

Connector/ODBC 的过时名称。 Obsolete name for Connector/ODBC.

另见 Connector/ODBC。See Also Connector/ODBC.

mysql

mysql 程序是 MySQL 数据库的命令行解释器。它处理 SQL 语句,以及 MySQL 特定命令,例如 SHOW TABLES,通过将请求传递给 mysqld 守护进程。 The mysql program is the command-line interpreter for the MySQL database. It processes SQL statements, and also MySQL-specific commands such as SHOW TABLES, by passing requests to the mysqld daemon.

另请参见 mysqld,SQL。See Also mysqld, SQL.

mysqlbackup 命令mysqlbackup command

MySQL 企业备份 产品的一个命令行工具。它对 InnoDB 表执行 热备份 操作,对 MyISAM 以及其他类型的表执行 温备份。有关此命令的更多信息,请参见 第 32.1 节,“MySQL 企业备份概述”。 A command-line tool of the MySQL Enterprise Backup product. It performs a hot backup operation for InnoDB tables, and a warm backup for MyISAM and other kinds of tables. See Section 32.1, “MySQL Enterprise Backup Overview” for more information about this command.

另见 热备份、MySQL 企业备份、温备份。See Also hot backup, MySQL Enterprise Backup, warm backup.

mysqlclient

非正式名称,用于指由文件 libmysqlclient 实现的库,文件扩展名为 .a 或 .so。 The informal name for the library that is implemented by the file libmysqlclient, with extension .a or .so.

另请参阅 libmysqlclient。See Also libmysqlclient.

mysqld

mysqld,也称为 MySQL 服务器,是一个单一的多线程程序,在 MySQL 安装中完成大部分工作。它不会生成额外的进程。MySQL 服务器管理对包含数据库、表以及其他信息(如日志文件和状态文件)的 MySQL 数据目录的访问。 mysqld, also known as MySQL Server, is a single multithreaded program that does most of the work in a MySQL installation. It does not spawn additional processes. MySQL Server manages access to the MySQL data directory that contains databases, tables, and other information such as log files and status files.

mysqld 作为 Unix 守护进程或 Windows 服务运行,持续等待请求并在后台执行维护工作。mysqld runs as a Unix daemon or Windows service, constantly waiting for requests and performing maintenance work in the background.

另请参见 实例,mysql。See Also instance, mysql.

MySQLdb

这是开源的 Python 模块名称,它构成了 MySQL Python API 的基础。 The name of the open-source Python module that forms the basis of the MySQL Python API.

另请参见 Python,Python API。See Also Python, Python API.

mysqldump

一个执行某些数据库、表和表数据组合的 逻辑备份 的命令。结果是可重现原始模式对象、数据或两者的 SQL 语句。对于大量数据,诸如 MySQL 企业备份 的 物理备份 解决方案更快,特别是在 恢复 操作上。 A command that performs a logical backup of some combination of databases, tables, and table data. The results are SQL statements that reproduce the original schema objects, data, or both. For substantial amounts of data, a physical backup solution such as MySQL Enterprise Backup is faster, particularly for the restore operation.

另请参见 逻辑备份、MySQL 企业备份、物理备份、恢复。See Also logical backup, MySQL Enterprise Backup, physical backup, restore.

NN

.NET

另见 ADO.NET、ASP.net、Connector/NET、Mono、Visual Studio。See Also ADO.NET, ASP.net, Connector/NET, Mono, Visual Studio.

本地 C APInative C API

libmysqlclient 的同义词。 Synonym for libmysqlclient.

另见 libmysql。See Also libmysql.

自然键natural key

一个被索引的列,通常是 主键,其值具有某种现实世界的意义。通常不建议使用,因为: An indexed column, typically a primary key, where the values have some real-world significance. Usually advised against because:

  • 如果该值将来需要更改,则可能需要进行大量的索引维护,以重新排序 聚集索引 并更新在每个 二级索引 中重复的主键值副本。If the value should ever change, there is potentially a lot of index maintenance to re-sort the clustered index and update the copies of the primary key value that are repeated in each secondary index.

  • 即使是看似稳定的数值也可能以难以在数据库中正确表示的不可预测方式发生变化。例如,一个国家可能会分裂成两个或多个国家,使原来的国家代码变得过时。或者,关于唯一值的规则可能会有例外。例如,即便纳税人身份证号本应唯一对应一个人,数据库仍可能需要处理违反这一规则的记录,比如身份盗用的情况。纳税人身份证号和其他敏感的身份证号码也不适合作为主键,因为它们可能需要加密、安全保护以及与其他列不同的处理方式。Even seemingly stable values can change in unpredictable ways that are difficult to represent correctly in the database. For example, one country can change into two or several, making the original country code obsolete. Or, rules about unique values might have exceptions. For example, even if taxpayer IDs are intended to be unique to a single person, a database might have to handle records that violate that rule, such as in cases of identity theft. Taxpayer IDs and other sensitive ID numbers also make poor primary keys, because they may need to be secured, encrypted, and otherwise treated differently than other columns.

因此,通常更好的是使用任意的数值来形成一个合成键,例如使用一个自增列。Thus, it is typically better to use arbitrary numeric values to form a synthetic key, for example using an auto-increment column.

另请参见 自动递增、聚集索引、主键、辅助索引、合成键。See Also auto-increment, clustered index, primary key, secondary index, synthetic key.

邻页neighbor page

与特定页面处于相同区段的任何页面。当一个页面被选择刷新时,任何处于脏状态的邻近页面通常也会被刷新,这是为了传统硬盘的 I/O 优化。在 MySQL 5.6 及更高版本中,这种行为可以通过配置变量 innodb_flush_neighbors 来控制;对于 SSD 驱动器,你可能会关闭该设置,因为 SSD 在随机位置写入较小批量数据时没有相同的开销。 Any page in the same extent as a particular page. When a page is selected to be flushed, any neighbor pages that are dirty are typically flushed as well, as an I/O optimization for traditional hard disks. In MySQL 5.6 and up, this behavior can be controlled by the configuration variable innodb_flush_neighbors; you might turn that setting off for SSD drives, which do not have the same overhead for writing smaller batches of data at random locations.

另请参见 脏页、区段、刷新、页。See Also dirty page, extent, flush, page.

下一个键锁next-key lock

在索引记录上的 记录锁 与索引记录前间隙上的 间隙锁 的组合。 A combination of a record lock on the index record and a gap lock on the gap before the index record.

另请参见 间隙锁、锁、记录锁。See Also gap lock, locking, record lock.

非锁定读取non-locking read

使用 SELECT ... FOR UPDATE 或 SELECT ... LOCK IN SHARE MODE 子句以外的 查询。这是在 只读事务 中允许对全局表进行的唯一类型查询。与 锁定读取 相反。参见 第 17.7.2.3 节,“一致性非锁定读取”。 A query that does not use the SELECT ... FOR UPDATE or SELECT ... LOCK IN SHARE MODE clauses. The only kind of query allowed for global tables in a read-only transaction. The opposite of a locking read. See Section 17.7.2.3, “Consistent Nonlocking Reads”.

SELECT ... FOR SHARE 在 MySQL 8.0.1 中取代了 SELECT ... LOCK IN SHARE MODE,但 LOCK IN SHARE MODE 仍可用于向后兼容。SELECT ... FOR SHARE replaces SELECT ... LOCK IN SHARE MODE in MySQL 8.0.1, but LOCK IN SHARE MODE remains available for backward compatibility.

另请参见 锁定读取、查询、只读事务。See Also locking read, query, read-only transaction.

不可重读读non-repeatable read

当一个查询检索到数据,而同一事务中的后续查询本应检索相同的数据时,却返回了不同的结果(在此期间被另一个事务提交而改变)。 The situation when a query retrieves data, and a later query within the same transaction retrieves what should be the same data, but the queries return different results (changed by another transaction committing in the meantime).

这种操作违反了数据库设计的ACID原则。在一个事务中,数据应该保持一致,关系应可预测且稳定。This kind of operation goes against the ACID principle of database design. Within a transaction, data should be consistent, with predictable and stable relationships.

在不同的隔离级别中,不可重复读被可串行化读取和可重复读级别所防止,而在一致性读取和未提交读级别中则允许发生。Among different isolation levels, non-repeatable reads are prevented by the serializable read and repeatable read levels, and allowed by the consistent read, and read uncommitted levels.

另请参见 ACID,一致性读,隔离级别,未提交读(READ UNCOMMITTED),可重复读(REPEATABLE READ),可串行化(SERIALIZABLE),事务。See Also ACID, consistent read, isolation level, READ UNCOMMITTED, REPEATABLE READ, SERIALIZABLE, transaction.

非阻塞 I/Ononblocking I/O

这是一个行业术语,意思与 异步 I/O 相同。 An industry term that means the same as asynchronous I/O.

另请参见 异步 I/O。See Also asynchronous I/O.

规范化normalized

一种数据库设计策略,将数据分割到多个表中,并通过一个 ID 将重复值压缩到单行,以避免存储、查询和更新冗余或冗长的值。它通常用于 联机事务处理(OLTP) 应用中。 A database design strategy where data is split into multiple tables, and duplicate values condensed into single rows represented by an ID, to avoid storing, querying, and updating redundant or lengthy values. It is typically used in OLTP applications.

例如,一个地址可以被分配一个唯一的 ID,这样人口普查数据库就可以通过将该 ID 与每个家庭成员关联来表示 住在该地址 的关系,而不是存储多个复杂值的副本,例如 美国,安 ytown 市,主街 123 号。For example, an address might be given a unique ID, so that a census database could represent the relationship lives at this address by associating that ID with each member of a family, rather than storing multiple copies of a complex value such as 123 Main Street, Anytown, USA.

举另一个例子,虽然一个简单的地址簿应用程序可能会把每个电话号码存储在与人的姓名和地址相同的表中,但电话公司数据库可能会给每个电话号码分配一个特殊的 ID,并将号码和 ID 存储在单独的表中。这种规范化的表示方式可以简化当区号拆分时的大规模更新。For another example, although a simple address book application might store each phone number in the same table as a person's name and address, a phone company database might give each phone number a special ID, and store the numbers and IDs in a separate table. This normalized representation could simplify large-scale updates when area codes split apart.

规范化并不总是推荐的。那些主要用于查询、并且只通过完全删除后重新加载来更新的数据,通常会保存在更少、更大的表中,并保留重复值的冗余副本。这种表示方式被称为非规范化,并且经常出现在数据仓库应用中。Normalization is not always recommended. Data that is primarily queried, and only updated by deleting entirely and reloading, is often kept in fewer, larger tables with redundant copies of duplicate values. This data representation is referred to as denormalized, and is frequently found in data warehousing applications.

另请参见 非规范化、外键、联机事务处理(OLTP)、关系型。See Also denormalized, foreign key, OLTP, relational.

NoSQL

一个广泛的术语,用于描述一组不使用 SQL 语言作为其主要读写数据机制的数据访问技术。一些 NoSQL 技术充当键值存储,只接受单值的读取和写入;一些放宽了 ACID 方法论的限制;还有一些不需要预先规划的 schema。MySQL 用户可以通过使用 memcached API 直接访问某些类型的 MySQL 表,将 NoSQL 风格的处理(以提高速度和简便性)与 SQL 操作(以获得灵活性和便利性)相结合。 A broad term for a set of data access technologies that do not use the SQL language as their primary mechanism for reading and writing data. Some NoSQL technologies act as key-value stores, only accepting single-value reads and writes; some relax the restrictions of the ACID methodology; still others do not require a pre-planned schema. MySQL users can combine NoSQL-style processing for speed and simplicity with SQL operations for flexibility and convenience, by using the memcached API to directly access some kinds of MySQL tables.

另请参阅 ACID、memcached、schema、SQL。See Also ACID, memcached, schema, SQL.

NOT NULL 约束NOT NULL constraint

一种 约束 类型,指定某个 列不能包含任何 NULL 值。它有助于保持 参照完整性,因为数据库服务器可以识别存在错误缺失值的数据。它还在查询优化涉及的算术运算中提供帮助,使优化器能够预测该列索引中的条目数量。 A type of constraint that specifies that a column cannot contain any NULL values. It helps to preserve referential integrity, as the database server can identify data with erroneous missing values. It also helps in the arithmetic involved in query optimization, allowing the optimizer to predict the number of entries in an index on that column.

另请参见 列,约束,NULL,主键,参照完整性。See Also column, constraint, NULL, primary key, referential integrity.

NULL

在 SQL 中的一个特殊值,表示数据的缺失。任何涉及 NULL 值的算术操作或等值测试,结果都将产生 NULL。 (因此它类似于 IEEE 浮点数中的 NaN 概念,“不是数字”。)任何聚合计算如 AVG() 在确定除以多少行时,会忽略包含 NULL 值的行。唯一可用于 NULL 值的测试是使用 SQL 习语 IS NULL 或 IS NOT NULL。 A special value in SQL, indicating the absence of data. Any arithmetic operation or equality test involving a NULL value, in turn produces a NULL result. (Thus it is similar to the IEEE floating-point concept of NaN, “not a number”.) Any aggregate calculation such as AVG() ignores rows with NULL values, when determining how many rows to divide by. The only test that works with NULL values uses the SQL idioms IS NULL or IS NOT NULL.

NULL 值在 索引 操作中起到一定作用,因为为了性能,数据库必须尽量减少跟踪缺失数据值的开销。通常,NULL 值不会存储在索引中,因为使用标准比较运算符测试索引列的查询永远无法匹配该列值为 NULL 的行。出于同样的原因,唯一索引不会阻止 NULL 值;这些值只是没有在索引中表示。在列上声明 NOT NULL 约束可以确保索引中不会遗漏任何行,从而允许更好的查询优化(准确计算行数并估计是否使用索引)。NULL values play a part in index operations, because for performance a database must minimize the overhead of keeping track of missing data values. Typically, NULL values are not stored in an index, because a query that tests an indexed column using a standard comparison operator could never match a row with a NULL value for that column. For the same reason, unique indexes do not prevent NULL values; those values simply are not represented in the index. Declaring a NOT NULL constraint on a column provides reassurance that there are no rows left out of the index, allowing for better query optimization (accurate counting of rows and estimation of whether to use the index).

因为主键必须能够唯一标识表中的每一行,所以单列主键不能包含任何NULL值,多列主键则不能包含所有列都是NULL值的行。Because the primary key must be able to uniquely identify every row in the table, a single-column primary key cannot contain any NULL values, and a multi-column primary key cannot contain any rows with NULL values in all columns.

虽然 Oracle 数据库允许将NULL值与字符串连接,但InnoDB将此类操作的结果视为NULL。Although the Oracle database allows a NULL value to be concatenated with a string, InnoDB treats the result of such an operation as NULL.

另请参见 索引、主键、SQL。See Also index, primary key, SQL.

OO

.OPT 文件.OPT file

包含数据库配置信息的文件。具有此扩展名的文件包含在 mysqlbackup 命令生成的备份中,该命令属于 MySQL Enterprise Backup 产品。 A file containing database configuration information. Files with this extension are included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product.

参见 MySQL 企业版备份,mysqlbackup 命令。See Also MySQL Enterprise Backup, mysqlbackup command.

ODBC

Open Database Connectivity(开放数据库连接)的缩写,一种行业标准 API。通常用于基于 Windows 的服务器,或需要通过 ODBC 与 MySQL 通信的应用程序。MySQL 的 ODBC 驱动程序称为 Connector/ODBC。 Acronym for Open Database Connectivity, an industry-standard API. Typically used with Windows-based servers, or applications that require ODBC to communicate with MySQL. The MySQL ODBC driver is called Connector/ODBC.

另见 Connector/ODBC。See Also Connector/ODBC.

页面外列off-page column

一列包含可变长度的数据(例如 BLOB 和 VARCHAR),这些数据过大,无法放入 B-tree 页中。数据存储在 溢出页 中。对于这种存储,DYNAMIC 行格式比较旧的 COMPACT 行格式更高效。 A column containing variable-length data (such as BLOB and VARCHAR) that is too long to fit on a B-tree page. The data is stored in overflow pages. The DYNAMIC row format is more efficient for such storage than the older COMPACT row format.

另请参见 B 树、紧凑行格式、动态行格式、溢出页。See Also B-tree, compact row format, dynamic row format, overflow page.

联机事务处理(OLTP)OLTP

Acronym for “Online Transaction Processing”. A database system, or a database application, that runs a workload with many 事务, with frequent writes as well as reads, typically affecting small amounts of data at a time. For example, an airline reservation system or an application that processes bank deposits. The data might be organized in normalized form for a balance between DML (insert/update/delete) efficiency and query efficiency. Contrast with data warehouse. Acronym for “Online Transaction Processing”. A database system, or a database application, that runs a workload with many transactions, with frequent writes as well as reads, typically affecting small amounts of data at a time. For example, an airline reservation system or an application that processes bank deposits. The data might be organized in normalized form for a balance between DML (insert/update/delete) efficiency and query efficiency. Contrast with data warehouse.

凭借其行级锁和事务性能力,InnoDB是用于 OLTP 应用程序的 MySQL 表的理想存储引擎。With its row-level locking and transactional capability, InnoDB is the ideal storage engine for MySQL tables used in OLTP applications.

另请参见 数据仓库、DML、InnoDB、查询、行锁、事务。See Also data warehouse, DML, InnoDB, query, row lock, transaction.

在线online

一种操作类型,不会导致数据库停机、阻塞或受限操作。通常应用于 DDL。缩短受限操作时间的操作,例如 快速索引创建,已在 MySQL 5.6 中演变为更广泛的 在线 DDL 操作。 A type of operation that involves no downtime, blocking, or restricted operation for the database. Typically applied to DDL. Operations that shorten the periods of restricted operation, such as fast index creation, have evolved into a wider set of online DDL operations in MySQL 5.6.

在备份的上下文中,热备份 是在线操作,而 温备份 部分属于在线操作。In the context of backups, a hot backup is an online operation and a warm backup is partially an online operation.

另请参阅 DDL、快速索引创建、热备份、在线 DDL、温备份。See Also DDL, Fast Index Creation, hot backup, online DDL, warm backup.

在线 DDLonline DDL

一个在 DDL(主要是 ALTER TABLE)操作期间提升 InnoDB 表性能、并发性和可用性的功能。详情请参见 第 17.12 节,“InnoDB 和在线 DDL”。 A feature that improves the performance, concurrency, and availability of InnoDB tables during DDL (primarily ALTER TABLE) operations. See Section 17.12, “InnoDB and Online DDL” for details.

具体细节取决于操作类型。在某些情况下,表可以在 ALTER TABLE 正在进行的同时被修改。操作可能无需表复制即可执行,或者使用一种经过特别优化的表复制类型。就地操作的 DML 日志空间使用由 innodb_online_alter_log_max_size 配置选项控制。The details vary according to the type of operation. In some cases, the table can be modified concurrently while the ALTER TABLE is in progress. The operation might be able to be performed without a table copy, or using a specially optimized type of table copy. DML log space usage for in-place operations is controlled by the innodb_online_alter_log_max_size configuration option.

该功能是 MySQL 5.5 中 快速索引创建 功能的增强版。This feature is an enhancement of the Fast Index Creation feature in MySQL 5.5.

另请参见 DDL、快速索引创建、在线。See Also DDL, Fast Index Creation, online.

乐观optimistic

一种指导关系数据库系统低级实现决策的方法论。关系数据库中性能和并发的要求意味着操作必须迅速启动或分派。数据一致性和引用完整性的要求意味着任何操作都有可能失败:事务可能会回滚,DML 操作可能违反约束,请求锁可能导致死锁,网络错误可能导致超时。乐观策略是假设大多数请求或尝试都会成功,因此为了应对失败情况所做的工作相对较少。当这一假设成立时,数据库几乎不做不必要的工作;当请求确实失败时,就必须进行额外的工作来清理和撤销更改。 A methodology that guides low-level implementation decisions for a relational database system. The requirements of performance and concurrency in a relational database mean that operations must be started or dispatched quickly. The requirements of consistency and referential integrity mean that any operation could fail: a transaction might be rolled back, a DML operation could violate a constraint, a request for a lock could cause a deadlock, a network error could cause a timeout. An optimistic strategy is one that assumes most requests or attempts succeed, so that relatively little work is done to prepare for the failure case. When this assumption is true, the database does little unnecessary work; when requests do fail, extra work must be done to clean up and undo changes.

InnoDB 对诸如 锁定 和 提交 等操作采用乐观策略。例如,事务修改的数据可以在提交发生之前写入数据文件,从而使提交本身非常快,但如果事务回滚,则需要更多的工作来撤销更改。InnoDB uses optimistic strategies for operations such as locking and commits. For example, data changed by a transaction can be written to the data files before the commit occurs, making the commit itself very fast, but requiring more work to undo the changes if the transaction is rolled back.

与乐观策略相反的是 悲观 策略,其中系统优化以处理不可靠且经常失败的操作。这种方法在数据库系统中很少见,因为选择可靠的硬件、网络和算法需要大量的注意。The opposite of an optimistic strategy is a pessimistic one, where a system is optimized to deal with operations that are unreliable and frequently unsuccessful. This methodology is rare in a database system, because so much care goes into choosing reliable hardware, networks, and algorithms.

另请参阅 提交、并发、DML、锁定、悲观、参照完整性。See Also commit, concurrency, DML, locking, pessimistic, referential integrity.

优化器optimizer

MySQL 组件,根据相关表的特性和数据分布,确定在 查询 中使用的最佳 索引 和 连接 顺序。 The MySQL component that determines the best indexes and join order to use for a query, based on characteristics and data distribution of the relevant tables.

另请参见 索引, 联接, 查询, 表。See Also index, join, query, table.

选项option

MySQL 的一个配置参数,可以存储在 选项文件 中,或通过命令行传递。 A configuration parameter for MySQL, either stored in the option file or passed on the command line.

对于适用于 InnoDB 表的 选项,每个选项名称都以前缀 innodb_ 开头。For the options that apply to InnoDB tables, each option name starts with the prefix innodb_.

另请参见 InnoDB、选项、选项文件。See Also InnoDB, option, option file.

选项文件option file

用于保存 MySQL 实例配置选项的文件。传统上,在 Linux 和 Unix 系统上,此文件名为 my.cnf,而在 Windows 系统上命名为 my.ini。 The file that holds the configuration options for the MySQL instance. Traditionally, on Linux and Unix this file is named my.cnf, and on Windows it is named my.ini.

另请参见 配置文件、my.cnf、my.ini、选项。See Also configuration file, my.cnf, my.ini, option.

溢出页overflow page

单独分配的磁盘页,用于存放过长而无法放入B 树页的可变长度列(例如BLOB和VARCHAR)。相关的列被称为页外列。 Separately allocated disk pages that hold variable-length columns (such as BLOB and VARCHAR) that are too long to fit on a B-tree page. The associated columns are known as off-page columns.

另请参见 B 树、页外列、页。See Also B-tree, off-page column, page.

PP

.par 文件.par file

一个包含分区定义的文件。具有此扩展名的文件会被 MySQL Enterprise Backup 产品的 mysqlbackup 命令生成的备份中包含。 A file containing partition definitions. Files with this extension are included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product.

随着 MySQL 5.7.6 对 InnoDB 表引入原生分区支持,分区的 .par 文件不再为 InnoDB 表创建。分区的 MyISAM 表在 MySQL 5.7 中仍然使用 .par 文件。在 MySQL 8.0 中,分区支持仅由 InnoDB 存储引擎提供。因此,从 MySQL 8.0 起,.par 文件不再使用。With the introduction of native partitioning support for InnoDB tables in MySQL 5.7.6, .par files are no longer created for partitioned InnoDB tables. Partitioned MyISAM tables continue to use .par files in MySQL 5.7. In MySQL 8.0, partitioning support is only provided by the InnoDB storage engine. As such, .par files are no longer used as of MySQL 8.0.

参见 MySQL 企业版备份,mysqlbackup 命令。See Also MySQL Enterprise Backup, mysqlbackup command.

页面page

一个表示 InnoDB 在一次从磁盘(数据文件)到内存(缓冲池)传输的数据量的单位。一个页面可以包含一个或多个 行,取决于每行的数据量。如果一行的数据无法完全放入单个页面,InnoDB 会设置额外的指针式数据结构,以便该行的信息可以存储在一个页面中。 A unit representing how much data InnoDB transfers at any one time between disk (the data files) and memory (the buffer pool). A page can contain one or more rows, depending on how much data is in each row. If a row does not fit entirely into a single page, InnoDB sets up additional pointer-style data structures so that the information about the row can be stored in one page.

在每页中容纳更多数据的一种方法是使用压缩行格式。对于使用 BLOB 或大文本字段的表,紧凑行格式允许将这些大列与行的其余部分分开存储,从而减少对不引用这些列的查询的 I/O 开销和内存使用。One way to fit more data in each page is to use compressed row format. For tables that use BLOBs or large text fields, compact row format allows those large columns to be stored separately from the rest of the row, reducing I/O overhead and memory usage for queries that do not reference those columns.

当InnoDB作为批处理读取或写入页集以提高 I/O 吞吐量时,它一次读取或写入一个区段。When InnoDB reads or writes sets of pages as a batch to increase I/O throughput, it reads or writes an extent at a time.

MySQL 实例中的所有InnoDB磁盘数据结构共享相同的页大小。All the InnoDB disk data structures within a MySQL instance share the same page size.

另请参见 缓冲池、紧凑行格式、压缩行格式、数据文件、区间、页大小、行。See Also buffer pool, compact row format, compressed row format, data files, extent, page size, row.

页清理器page cleaner

一个 InnoDB 后台 线程,用于从 缓冲池中 刷新 脏页。在 MySQL 5.6 之前,这一操作由 主线程 执行。页面清理线程的数量由 innodb_page_cleaners 配置选项控制,该选项在 MySQL 5.7.4 中引入。 An InnoDB background thread that flushes dirty pages from the buffer pool. Prior to MySQL 5.6, this activity was performed by the master thread. The number of page cleaner threads is controlled by the innodb_page_cleaners configuration option, introduced in MySQL 5.7.4.

另请参见 缓冲池、脏页、刷新、主线程、线程。See Also buffer pool, dirty page, flush, master thread, thread.

页面大小page size

对于直到 MySQL 5.5 版本的发行版,每个 InnoDB 页面 的大小固定为 16 KB。这个值代表了一种平衡:足够大以容纳大多数行的数据,同时又足够小以最小化将不需要的数据传输到内存的性能开销。其他值未经测试或不受支持。 For releases up to and including MySQL 5.5, the size of each InnoDB page is fixed at 16 kilobytes. This value represents a balance: large enough to hold the data for most rows, yet small enough to minimize the performance overhead of transferring unneeded data to memory. Other values are not tested or supported.

从 MySQL 5.6 开始,InnoDB 实例 的页面大小可以是 4KB、8KB 或 16KB,由 innodb_page_size 配置选项控制。从 MySQL 5.7.6 开始,InnoDB 还支持 32KB 和 64KB 页面大小。对于 32KB 和 64KB 页面大小,不支持 ROW_FORMAT=COMPRESSED,并且最大记录大小为 16KB。Starting in MySQL 5.6, the page size for an InnoDB instance can be either 4KB, 8KB, or 16KB, controlled by the innodb_page_size configuration option. As of MySQL 5.7.6, InnoDB also supports 32KB and 64KB page sizes. For 32KB and 64KB page sizes, ROW_FORMAT=COMPRESSED is not supported and the maximum record size is 16KB.

页面大小是在创建 MySQL 实例时设置的,之后保持不变。相同的页面大小适用于所有 InnoDB 表空间,包括 系统表空间、每表文件(file-per-table)表空间 和 通用表空间。Page size is set when creating the MySQL instance, and it remains constant afterward. The same page size applies to all InnoDB tablespaces, including the system tablespace, file-per-table tablespaces, and general tablespaces.

较小的页面大小可以在使用小块大小的存储设备上提高性能,尤其是在 磁盘受限(disk-bound) 工作负载的 SSD 设备上,例如 在线事务处理(OLTP) 应用。当单个行被更新时,复制到内存、写入磁盘、重新组织、加锁等操作的数据量较少。Smaller page sizes can help performance with storage devices that use small block sizes, particularly for SSD devices in disk-bound workloads, such as for OLTP applications. As individual rows are updated, less data is copied into memory, written to disk, reorganized, locked, and so on.

另请参见 磁盘绑定, 每表文件, 通用表空间, 实例, OLTP, 页, SSD, 系统表空间, 表空间。See Also disk-bound, file-per-table, general tablespace, instance, OLTP, page, SSD, system tablespace, tablespace.

父表parent table

在外键关系中,父表是保存从子表指向的初始列值的表。删除或更新父表中的行的后果取决于外键定义中的ON UPDATE和ON DELETE子句。子表中具有对应值的行可能会被自动删除或更新,或者这些列可能被设置为NULL,也可能会阻止该操作。 The table in a foreign key relationship that holds the initial column values pointed to from the child table. The consequences of deleting, or updating rows in the parent table depend on the ON UPDATE and ON DELETE clauses in the foreign key definition. Rows with corresponding values in the child table could be automatically deleted or updated in turn, or those columns could be set to NULL, or the operation could be prevented.

另见 子表,外键。See Also child table, foreign key.

部分备份partial backup

一个包含 MySQL 数据库中部分 表 或 MySQL 实例中部分数据库的 备份。与 完整备份 相对。 A backup that contains some of the tables in a MySQL database, or some of the databases in a MySQL instance. Contrast with full backup.

另请参见 备份,完整备份,表。See Also backup, full backup, table.

部分索引partial index

一种只表示列值部分的 索引,通常是长 VARCHAR 值的前 N 个字符(前缀)。 An index that represents only part of a column value, typically the first N characters (the prefix) of a long VARCHAR value.

另请参阅 索引,索引前缀。See Also index, index prefix.

部分信任partial trust

通常由托管服务提供商使用的执行环境,其中应用程序拥有某些权限但没有其他权限。例如,应用程序可能能够通过网络访问数据库服务器,但在读取和写入本地文件方面则被“沙盒化”。 An execution environment typically used by hosting providers, where applications have some permissions but not others. For example, applications might be able to access a database server over a network, but be “sandboxed” with regard to reading and writing local files.

另请参阅 Connector/NET。See Also Connector/NET.

性能模式Performance Schema

在 MySQL 5.5 及更高版本中,performance_schema 模式提供了一组表,您可以查询这些表以获取有关 MySQL 服务器许多内部部分的性能特征的详细信息。参见 第 29 章,MySQL 性能模式。 The performance_schema schema, in MySQL 5.5 and up, presents a set of tables that you can query to get detailed information about the performance characteristics of many internal parts of the MySQL server. See Chapter 29, MySQL Performance Schema.

另请参阅 INFORMATION_SCHEMA、latch、mutex、rw-lock。See Also INFORMATION_SCHEMA, latch, mutex, rw-lock.

Perl

一种源自 Unix 脚本和报表生成的编程语言。融合了高性能的正则表达式和文件 I/O。通过诸如 CPAN 等仓库可以获取大量可重用模块。 A programming language with roots in Unix scripting and report generation. Incorporates high-performance regular expressions and file I/O. Large collection of reusable modules available through repositories such as CPAN.

另请参见 Perl API。See Also Perl API.

Perl API

一个开源的 API,用于用 Perl 语言编写的 MySQL 应用程序。通过 DBI 和 DBD::mysql 模块实现。详情请参见 第 31.9 节,“MySQL Perl API”。 An open-source API for MySQL applications written in the Perl language. Implemented through the DBI and DBD::mysql modules. For details, see Section 31.9, “MySQL Perl API”.

另请参见 API、Perl。See Also API, Perl.

持久统计persistent statistics

一个将 索引 统计信息存储在 InnoDB 表 磁盘上的功能,为 查询 提供更好的 执行计划稳定性。有关详细信息,请参见 第 17.8.10.1 节,“配置持久优化器统计参数”。 A feature that stores index statistics for InnoDB tables on disk, providing better plan stability for queries. For more information, see Section 17.8.10.1, “Configuring Persistent Optimizer Statistics Parameters”.

另请参见 索引、优化器、计划稳定性、查询、表。See Also index, optimizer, plan stability, query, table.

悲观的pessimistic

一种以安全性为代价牺牲性能或并发性的工作方法。如果高比例的请求或尝试可能会失败,或者请求失败的后果严重,这种方法是合适的。InnoDB 使用所谓的悲观锁定策略,以尽量减少死锁的可能性。在应用层面,你可以通过在事务开始时立即获取事务所需的所有锁,使用悲观策略来避免死锁。 A methodology that sacrifices performance or concurrency in favor of safety. It is appropriate if a high proportion of requests or attempts might fail, or if the consequences of a failed request are severe. InnoDB uses what is known as a pessimistic locking strategy, to minimize the chance of deadlocks. At the application level, you might avoid deadlocks by using a pessimistic strategy of acquiring all locks needed by a transaction at the very beginning.

许多内置数据库机制使用相对的乐观方法。Many built-in database mechanisms use the opposite optimistic methodology.

另见 死锁,锁定,乐观。See Also deadlock, locking, optimistic.

幻影phantom

在查询结果集中出现的行,但在早期查询的结果集中未出现。例如,如果在一个 事务 中执行同一个查询两次,而在此期间,另一个事务提交后插入了新行或更新了一行,使其匹配查询的 WHERE 子句。 A row that appears in the result set of a query, but not in the result set of an earlier query. For example, if a query is run twice within a transaction, and in the meantime, another transaction commits after inserting a new row or updating a row so that it matches the WHERE clause of the query.

这种现象被称为幻读。它比不可重复读更难防护,因为锁定第一次查询结果集中的所有行并不能阻止导致幻读出现的更改。This occurrence is known as a phantom read. It is harder to guard against than a non-repeatable read, because locking all the rows from the first query result set does not prevent the changes that cause the phantom to appear.

在不同的隔离级别中,幻读可以通过可串行化读取级别来防止,而在可重复读取、一致性读取和读未提交级别下则允许出现。Among different isolation levels, phantom reads are prevented by the serializable read level, and allowed by the repeatable read, consistent read, and read uncommitted levels.

另见 一致性读取、隔离级别、不可重复读取、READ UNCOMMITTED(未提交读)、REPEATABLE READ(可重复读)、SERIALIZABLE(可串行化)、事务。See Also consistent read, isolation level, non-repeatable read, READ UNCOMMITTED, REPEATABLE READ, SERIALIZABLE, transaction.

PHP

一种起源于网页应用程序的编程语言。代码通常作为块嵌入到网页源代码中,输出在网页通过网络服务器传输时被替换到页面中。这与如 CGI 脚本等应用程序形成对比,后者以整个网页的形式打印输出。PHP 编程风格用于高度交互和动态的网页。现代 PHP 程序也可以作为命令行或 GUI 应用程序运行。 A programming language originating with web applications. The code is typically embedded as blocks within the source of a web page, with the output substituted into the page as it is transmitted by the web server. This is in contrast to applications such as CGI scripts that print output in the form of an entire web page. The PHP style of coding is used for highly interactive and dynamic web pages. Modern PHP programs can also be run as command-line or GUI applications.

MySQL 应用程序使用其中一个 PHP API 编写。可重用模块可以用 C 编写,并从 PHP 调用。MySQL applications are written using one of the PHP APIs. Reusable modules can be written in C and called from PHP.

另一种使用 MySQL 编写服务器端网页的技术是 ASP.net。Another technology for writing server-side web pages with MySQL is ASP.net.

另请参见 ASP.net、C、PHP API。See Also ASP.net, C, PHP API.

PHP API

有几种 API 可用于用 PHP 语言编写 MySQL 应用程序:原始 MySQL API (Mysql)、MySQL 改进扩展 (Mysqli)、MySQL 本地驱动 (Mysqlnd)、MySQL 函数 (PDO_MYSQL) 以及 Connector/PHP。详情请参见 MySQL 和 PHP。 Several APIs are available for writing MySQL applications in the PHP language: the original MySQL API (Mysql) the MySQL Improved Extension (Mysqli) the MySQL Native Driver (Mysqlnd) the MySQL functions (PDO_MYSQL), and Connector/PHP. For details, see MySQL and PHP.

参见 API, PHP。See Also API, PHP.

物理physical

一种涉及与硬件相关方面的操作类型,例如磁盘块、内存页、文件、位、磁盘读等。通常,在专家级别的性能调优和问题诊断中,物理方面非常重要。与 逻辑 对比。 A type of operation that involves hardware-related aspects such as disk blocks, memory pages, files, bits, disk reads, and so on. Typically, physical aspects are important during expert-level performance tuning and problem diagnosis. Contrast with logical.

参见 逻辑, 物理备份。See Also logical, physical backup.

物理备份physical backup

A backup that copies the actual data files. For example, the mysqlbackup command of the MySQL Enterprise 备份 product produces a physical backup, because its output contains data files that can be used directly by the mysqld server, resulting in a faster restore operation. Contrast with logical backup. A backup that copies the actual data files. For example, the mysqlbackup command of the MySQL Enterprise Backup product produces a physical backup, because its output contains data files that can be used directly by the mysqld server, resulting in a faster restore operation. Contrast with logical backup.

另请参阅 备份, 逻辑备份, MySQL Enterprise Backup, 恢复。See Also backup, logical backup, MySQL Enterprise Backup, restore.

PITR

时间点恢复 的缩写。 Acronym for point-in-time recovery.

另请参见 时间点恢复。See Also point-in-time recovery.

计划稳定性plan stability

查询执行计划 的一个属性,其中优化器在每次处理给定 查询 时做出相同的选择,从而保证性能一致且可预测。 A property of a query execution plan, where the optimizer makes the same choices each time for a given query, so that performance is consistent and predictable.

另请参见 查询、查询执行计划。See Also query, query execution plan.

时间点恢复point-in-time recovery

将备份恢复以重现数据库在特定日期和时间的状态的过程。通常缩写为“PITR”。由于指定的时间不太可能与备份时间完全一致,这种技术通常需要物理备份和逻辑备份的组合。例如,在使用MySQL 企业备份产品时,您会先恢复所选时间点之前的最后一次备份,然后重新执行从备份时间到 PITR 时间之间二进制日志中的更改。 The process of restoring a backup to recreate the state of the database at a specific date and time. Commonly abbreviated “PITR”. Because it is unlikely that the specified time corresponds exactly to the time of a backup, this technique usually requires a combination of a physical backup and a logical backup. For example, with the MySQL Enterprise Backup product, you restore the last backup that you took before the specified point in time, then replay changes from the binary log between the time of the backup and the PITR time.

另请参见 备份、二进制日志、逻辑备份、MySQL 企业备份、物理备份。See Also backup, binary log, logical backup, MySQL Enterprise Backup, physical backup.

端口port

数据库服务器监听的 TCP/IP 套接字的编号,用于建立连接。通常与主机一起指定。根据您使用的网络加密情况,可能会有一个端口用于未加密的流量,另一个端口用于SSL连接。 The number of the TCP/IP socket the database server listens on, used to establish a connection. Often specified in conjunction with a host. Depending on your use of network encryption, there might be one port for unencrypted traffic and another port for SSL connections.

参见 连接、主机、SSL。See Also connection, host, SSL.

前缀prefix

参见 索引前缀。See index prefix.

预备备份prepared backup

一组备份文件,由 MySQL 企业备份 产品生成,在应用所有 二进制日志 和 增量备份 阶段完成后。生成的文件已准备好进行 恢复。在应用步骤之前,这些文件被称为 原始备份。 A set of backup files, produced by the MySQL Enterprise Backup product, after all the stages of applying binary logs and incremental backups are finished. The resulting files are ready to be restored. Prior to the apply steps, the files are known as a raw backup.

另请参见 二进制日志,热备份,增量备份,MySQL 企业备份,原始备份,恢复。See Also binary log, hot backup, incremental backup, MySQL Enterprise Backup, raw backup, restore.

预准备语句prepared statement

预处理语句是一种事先分析以确定高效执行计划的 SQL 语句。它可以被多次执行,而每次执行时无需重复解析和分析开销。每次可以通过使用占位符为 WHERE 子句中的字面值替换不同的值。这种替换技术提高了安全性,防止某些类型的 SQL 注入攻击。你还可以减少将返回值转换和复制到程序变量的开销。 An SQL statement that is analyzed in advance to determine an efficient execution plan. It can be executed multiple times, without the overhead for parsing and analysis each time. Different values can be substituted for literals in the WHERE clause each time, through the use of placeholders. This substitution technique improves security, protecting against some kinds of SQL injection attacks. You can also reduce the overhead for converting and copying return values to program variables.

虽然你可以直接通过 SQL 语法使用预处理语句,但各种 连接器 提供了用于操作预处理语句的编程接口,这些 API 比通过 SQL 更高效。Although you can use prepared statements directly through SQL syntax, the various Connectors have programming interfaces for manipulating prepared statements, and these APIs are more efficient than going through SQL.

另请参见 客户端预编译语句,连接器,服务器端预编译语句。See Also client-side prepared statement, connector, server-side prepared statement.

主键primary key

一组列——并且由此暗示的基于这组列的索引——能够唯一标识表中的每一行。因此,它必须是一个不包含任何 NULL 值的唯一索引。 A set of columns—and by implication, the index based on this set of columns—that can uniquely identify every row in a table. As such, it must be a unique index that does not contain any NULL values.

InnoDB 要求每个表都有这样的索引(也称为 聚簇索引 或 簇索引),并根据主键列的值来组织表的存储。InnoDB requires that every table has such an index (also called the clustered index or cluster index), and organizes the table storage based on the column values of the primary key.

在选择主键值时,考虑使用任意值(一个 合成键),而不是依赖于从其他来源派生的值(一个 自然键)。When choosing primary key values, consider using arbitrary values (a synthetic key) rather than relying on values derived from some other source (a natural key).

另请参见 聚簇索引、索引、自然键、合成键。See Also clustered index, index, natural key, synthetic key.

主体principal

Kerberos 对命名实体的术语,例如用户或服务器。 The Kerberos term for a named entity, such as a user or server.

另请参见 服务主体名称、用户主体名称。See Also service principal name, user principal name.

进程process

一个正在执行的程序实例。操作系统在多个运行的进程之间切换,从而允许一定程度的并发。在大多数操作系统中,进程可以包含多个共享资源的线程。线程之间的上下文切换比进程之间的切换更快。 An instance of an executing program. The operating system switches between multiple running processes, allowing for a certain degree of concurrency. On most operating systems, processes can contain multiple threads of execution that share resources. Context-switching between threads is faster than the equivalent switching between processes.

参见 并发, 线程。See Also concurrency, thread.

伪记录pseudo-record

在索引中的人工记录,用于锁定当前不存在的键值或范围。 An artificial record in an index, used for locking key values or ranges that do not currently exist.

参见 最小记录, 锁定, 最大记录。See Also infimum record, locking, supremum record.

Pthreads

POSIX 线程标准,它定义了 Unix 和 Linux 系统上的线程和锁操作的 API。在 Unix 和 Linux 系统上,InnoDB 使用该实现来处理 互斥锁。 The POSIX threads standard, which defines an API for threading and locking operations on Unix and Linux systems. On Unix and Linux systems, InnoDB uses this implementation for mutexes.

另请参见 互斥锁。See Also mutex.

清除purge

一种由一个或多个独立后台线程执行的垃圾回收类型(由 innodb_purge_threads 控制),按定期计划运行。清理(Purge)解析并处理来自 历史列表 的 回滚日志 页面,目的是删除先前由 DELETE 语句标记为删除的聚簇索引和辅助索引记录,并且这些记录不再需要用于 MVCC 或 回滚。清理在处理这些页面后会释放历史列表中的回滚日志页面。 A type of garbage collection performed by one or more separate background threads (controlled by innodb_purge_threads) that runs on a periodic schedule. Purge parses and processes undo log pages from the history list for the purpose of removing clustered and secondary index records that were marked for deletion (by previous DELETE statements) and are no longer required for MVCC or rollback. Purge frees undo log pages from the history list after processing them.

另请参见 历史列表、MVCC、回滚、回滚日志。See Also history list, MVCC, rollback, undo log.

清除缓冲purge buffering

将由于 DELETE 操作引起的二级索引页的更改存储在 更改缓冲区 中的技术,而不是立即写入这些更改,从而可以执行物理写入以最小化随机 I/O。(因为删除操作是一个两步过程,此操作会缓冲通常用于清除先前标记为删除的索引记录的写入。)它是 更改缓冲 的类型之一;其他类型是 插入缓冲 和 删除缓冲。 The technique of storing changes to secondary index pages, resulting from DELETE operations, in the change buffer rather than writing the changes immediately, so that the physical writes can be performed to minimize random I/O. (Because delete operations are a two-step process, this operation buffers the write that normally purges an index record that was previously marked for deletion.) It is one of the types of change buffering; the others are insert buffering and delete buffering.

另请参见 更改缓冲区、更改缓冲、删除缓冲、插入缓冲区、插入缓冲。See Also change buffer, change buffering, delete buffering, insert buffer, insert buffering.

清除延迟purge lag

是 InnoDB 历史列表 的另一种名称。与 innodb_max_purge_lag 配置选项相关。 Another name for the InnoDB history list. Related to the innodb_max_purge_lag configuration option.

另请参阅 历史列表,清理。See Also history list, purge.

清理线程purge thread

在 InnoDB 进程中,一个专门用于执行定期 清理 操作的 线程。在 MySQL 5.6 及更高版本中,可以通过 innodb_purge_threads 配置选项启用多个清理线程。 A thread within the InnoDB process that is dedicated to performing the periodic purge operation. In MySQL 5.6 and higher, multiple purge threads are enabled by the innodb_purge_threads configuration option.

另请参阅 清理,线程。See Also purge, thread.

Python

A programming language used in a broad range of fields, from Unix scripting to large-scale applications. Includes runtime typing, built-in high-level data types, object-oriented features, and an extensive standard library. Often used as a “glue” language between components written in other languages. The MySQL Python API is the open-source MySQLdb模块。 A programming language used in a broad range of fields, from Unix scripting to large-scale applications. Includes runtime typing, built-in high-level data types, object-oriented features, and an extensive standard library. Often used as a “glue” language between components written in other languages. The MySQL Python API is the open-source MySQLdb module.

另请参见 MySQLdb, Python API。See Also MySQLdb, Python API.

Python API

另请参见 API, Python。See Also API, Python.

QQ

查询query

在 SQL 中,一种从一个或多个 表 中读取信息的操作。根据数据的组织方式和查询的参数,查找可能通过参考 索引 来优化。如果涉及多个表,该查询被称为 连接。 In SQL, an operation that reads information from one or more tables. Depending on the organization of data and the parameters of the query, the lookup might be optimized by consulting an index. If multiple tables are involved, the query is known as a join.

出于历史原因,有时对语句的内部处理讨论中会更广泛地使用 “查询”,包括其他类型的 MySQL 语句,如 DDL 和 DML 语句。For historical reasons, sometimes discussions of internal processing for statements use “query” in a broader sense, including other types of MySQL statements such as DDL and DML statements.

另请参见 DDL、DML、索引、连接、SQL、表。See Also DDL, DML, index, join, SQL, table.

查询执行计划query execution plan

优化器关于如何最有效地执行 查询 所作决定的集合,包括使用哪个 索引 或哪些索引,以及 连接 表的顺序。计划稳定性 涉及对给定查询始终做出相同的选择。 The set of decisions made by the optimizer about how to perform a query most efficiently, including which index or indexes to use, and the order in which to join tables. Plan stability involves the same choices being made consistently for a given query.

另请参见 索引、连接、计划稳定性、查询。See Also index, join, plan stability, query.

查询日志query log

见 通用查询日志。See general query log.

静止quiesce

为了减少数据库活动的数量,通常是在准备进行某种操作(如 ALTER TABLE)、备份 或 关闭 时。可能会或者可能不会尽量进行 刷新,以便 InnoDB 不继续进行后台 I/O。 To reduce the amount of database activity, often in preparation for an operation such as an ALTER TABLE, a backup, or a shutdown. Might or might not involve doing as much flushing as possible, so that InnoDB does not continue doing background I/O.

在 MySQL 5.6 及更高版本中,语法 FLUSH TABLES ... FOR EXPORT 会将部分数据写入 InnoDB 表的磁盘,从而通过复制数据文件更容易地备份这些表。In MySQL 5.6 and higher, the syntax FLUSH TABLES ... FOR EXPORT writes some data to disk for InnoDB tables that make it simpler to back up those tables by copying the data files.

另请参见 备份,刷新,InnoDB,关机。See Also backup, flush, InnoDB, shutdown.

RR

R 树R-tree

一种用于多维数据(如地理坐标、矩形或多边形)的空间索引的树形数据结构。 A tree data structure used for spatial indexing of multi-dimensional data such as geographical coordinates, rectangles or polygons.

另请参见 B 树。See Also B-tree.

RAID

Acronym for “Redundant Array of Inexpensive Drives”. Spreading I/O operations across multiple drives enables greater concurrency at the hardware level, and improves the efficiency of low-level write operations that otherwise would be performed in sequence.

另见 并发性。See Also concurrency.

随机抽样random dive

一种快速估算列中不同值数量(该列的 基数)的技术。InnoDB 从索引中随机抽取页,并利用这些数据来估算不同值的数量。 A technique for quickly estimating the number of different values in a column (the column's cardinality). InnoDB samples pages at random from the index and uses that data to estimate the number of different values.

另请参见 基数。See Also cardinality.

原始备份raw backup

由 MySQL 企业备份 产品生成的初始备份文件集,在应用 二进制日志 和任何 增量备份 中反映的更改之前。在此阶段,这些文件尚未准备好 恢复。在应用这些更改后,这些文件称为 已准备备份。 The initial set of backup files produced by the MySQL Enterprise Backup product, before the changes reflected in the binary log and any incremental backups are applied. At this stage, the files are not ready to restore. After these changes are applied, the files are known as a prepared backup.

另见 二进制日志,热备份,ibbackup_logfile,增量备份,MySQL 企业备份,预备备份,恢复。See Also binary log, hot backup, ibbackup_logfile, incremental backup, MySQL Enterprise Backup, prepared backup, restore.

读已提交READ COMMITTED

一种使用锁定策略的隔离级别,该策略在性能的考虑下放松了一些事务之间的保护。事务无法看到其他事务未提交的数据,但可以看到在当前事务开始后由另一个事务提交的数据。因此,事务永远不会看到任何错误的数据,但它所看到的数据在某种程度上可能依赖于其他事务的时间安排。 An isolation level that uses a locking strategy that relaxes some of the protection between transactions, in the interest of performance. Transactions cannot see uncommitted data from other transactions, but they can see data that is committed by another transaction after the current transaction started. Thus, a transaction never sees any bad data, but the data that it does see may depend to some extent on the timing of other transactions.

当具有此隔离级别的事务执行 UPDATE ... WHERE 或 DELETE ... WHERE 操作时,其他事务可能需要等待。该事务可以执行 SELECT ... FOR UPDATE 和 LOCK IN SHARE MODE 操作而不会使其他事务等待。When a transaction with this isolation level performs UPDATE ... WHERE or DELETE ... WHERE operations, other transactions might have to wait. The transaction can perform SELECT ... FOR UPDATE, and LOCK IN SHARE MODE operations without making other transactions wait.

SELECT ... FOR SHARE 在 MySQL 8.0.1 中取代了 SELECT ... LOCK IN SHARE MODE,但 LOCK IN SHARE MODE 仍可用于向后兼容。SELECT ... FOR SHARE replaces SELECT ... LOCK IN SHARE MODE in MySQL 8.0.1, but LOCK IN SHARE MODE remains available for backward compatibility.

另请参阅 ACID、隔离级别、锁定、可重复读、可串行化、事务。See Also ACID, isolation level, locking, REPEATABLE READ, SERIALIZABLE, transaction.

读现象read phenomena

当一个事务读取另一个事务已修改的数据时,可能发生的现象,如 脏读、不可重复读 和 幻读。 Phenomena such as dirty reads, non-repeatable reads, and phantom reads which can occur when a transaction reads data that another transaction has modified.

另请参见 脏读、不可重复读、幻读。See Also dirty read, non-repeatable read, phantom.

读未提交 (READ UNCOMMITTED)READ UNCOMMITTED

提供事务之间最少保护的隔离级别。查询采用一种锁定策略,使得在通常需要等待其他事务的情况下也可以继续进行。然而,这种额外的性能是以结果可靠性降低为代价的,包括可能被其他事务修改但尚未提交的数据(称为脏读)。使用这种隔离级别时要非常谨慎,并且要意识到结果可能不一致或不可重复,这取决于同时其他事务的操作。通常,使用这种隔离级别的事务只执行查询,而不执行插入、更新或删除操作。 The isolation level that provides the least amount of protection between transactions. Queries employ a locking strategy that allows them to proceed in situations where they would normally wait for another transaction. However, this extra performance comes at the cost of less reliable results, including data that has been changed by other transactions and not committed yet (known as dirty read). Use this isolation level with great caution, and be aware that the results might not be consistent or reproducible, depending on what other transactions are doing at the same time. Typically, transactions with this isolation level only do queries, not insert, update, or delete operations.

另请参阅 ACID、脏读、隔离级别、锁定、事务。See Also ACID, dirty read, isolation level, locking, transaction.

读取视图read view

由 MVCC 机制在 InnoDB 中使用的内部快照。某些 事务 根据它们的 隔离级别,会看到事务(或在某些情况下是语句)开始时的数据值。使用读取视图的隔离级别有 可重复读、提交读 和 未提交读。 An internal snapshot used by the MVCC mechanism of InnoDB. Certain transactions, depending on their isolation level, see the data values as they were at the time the transaction (or in some cases, the statement) started. Isolation levels that use a read view are REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED.

另见 隔离级别、MVCC、已提交读、未提交读、可重复读、事务。See Also isolation level, MVCC, READ COMMITTED, READ UNCOMMITTED, REPEATABLE READ, transaction.

预读取read-ahead

一种 I/O 请求类型,会异步预取一组 页(整个 范围)到 缓冲池,以防这些页很快被需要。线性预读技术根据前一个范围中的页的访问模式,预取一个范围中的所有页。随机预读技术在缓冲池中存在来自同一范围的一定数量页时,会预取该范围的所有页。随机预读不是 MySQL 5.5 的一部分,但在 MySQL 5.6 中重新引入,受 innodb_random_read_ahead 配置选项的控制。 A type of I/O request that prefetches a group of pages (an entire extent) into the buffer pool asynchronously, in case these pages are needed soon. The linear read-ahead technique prefetches all the pages of one extent based on access patterns for pages in the preceding extent. The random read-ahead technique prefetches all the pages for an extent once a certain number of pages from the same extent are in the buffer pool. Random read-ahead is not part of MySQL 5.5, but is re-introduced in MySQL 5.6 under the control of the innodb_random_read_ahead configuration option.

另请参见 缓冲池、区间、页。See Also buffer pool, extent, page.

只读事务read-only transaction

A type of transaction that can be optimized for InnoDB tables by eliminating some of the bookkeeping involved with creating a read view for each transaction. Can only perform non-locking read queries. It can be started explicitly with the syntax START TRANSACTION READ ONLY, or automatically under certain conditions. See Section 10.5.3, “Optimizing InnoDB Read-Only Transactions” for details.

另请参见 非锁定读取,读取视图,事务。See Also non-locking read, read view, transaction.

记录锁record lock

对索引记录的 锁。例如,SELECT c1 FROM t WHERE c1 = 10 FOR UPDATE; 防止任何其他事务插入、更新或删除 t.c1 为 10 的行。与 间隙锁 和 下一键锁 形成对比。 A lock on an index record. For example, SELECT c1 FROM t WHERE c1 = 10 FOR UPDATE; prevents any other transaction from inserting, updating, or deleting rows where the value of t.c1 is 10. Contrast with gap lock and next-key lock.

另请参见 间隙锁、锁、下一个键锁。See Also gap lock, lock, next-key lock.

重做redo

当 DML 语句对 InnoDB 表进行更改时,记录在 重做日志 中的数据,以记录条目为单位。它在 崩溃恢复 期间用于纠正未完成 事务 写入的数据。不断增加的 LSN 值表示通过重做日志传递的重做数据的累积量。 The data, in units of records, recorded in the redo log when DML statements make changes to InnoDB tables. It is used during crash recovery to correct data written by incomplete transactions. The ever-increasing LSN value represents the cumulative amount of redo data that has passed through the redo log.

另请参见 故障恢复、DML、LSN、重做日志、事务。See Also crash recovery, DML, LSN, redo log, transaction.

重做日志redo log

A disk-based data structure used during crash recovery, to correct data written by incomplete 事务. During normal operation, it encodes requests to change InnoDB table data, which result from SQL statements or low-level API calls. Modifications that did not finish updating the data files before an unexpected shutdown are replayed automatically. A disk-based data structure used during crash recovery, to correct data written by incomplete transactions. During normal operation, it encodes requests to change InnoDB table data, which result from SQL statements or low-level API calls. Modifications that did not finish updating the data files before an unexpected shutdown are replayed automatically.

重做日志在磁盘上物理表现为一组重做日志文件。重做日志数据按所影响的记录进行编码;这些数据统称为 重做。数据通过重做日志的传递由不断增加的 LSN 值表示。The redo log is physically represented on disk as a set of redo log files. Redo log data is encoded in terms of records affected; this data is collectively referred to as redo. The passage of data through the redo log is represented by an ever-increasing LSN value.

欲了解更多信息,请参见 第 17.6.5 节,“重做日志”For more information, see Section 17.6.5, “Redo Log”

另请参见 崩溃恢复、数据文件、ib_logfile、日志缓冲区、LSN、重做、关闭、事务。See Also crash recovery, data files, ib_logfile, log buffer, LSN, redo, shutdown, transaction.

重做日志归档redo log archiving

InnoDB 的一个功能,当启用时,会将重做日志记录依次写入归档文件,以避免在备份操作进行时备份工具跟不上重做日志生成速度而可能导致的数据丢失。更多信息,请参见 重做日志归档。 An InnoDB feature that, when enabled, sequentially writes redo log records to an archive file to avoid potential loss of data than can occur when a backup utility fails to keep pace with redo log generation while a backup operation is in progress. For more information, see Redo Log Archiving.

另请参见 重做日志。See Also redo log.

冗余行格式redundant row format

最古老的 InnoDB 行格式。在 MySQL 5.0.3 之前,它是 InnoDB 中唯一可用的行格式。从 MySQL 5.0.3 到 MySQL 5.7.8,默认行格式是 COMPACT。从 MySQL 5.7.9 起,默认行格式由 innodb_default_row_format 配置选项定义,其默认设置为 DYNAMIC。你仍然可以指定 REDUNDANT 行格式,以兼容较旧的 InnoDB 表。 The oldest InnoDB row format. Prior to MySQL 5.0.3, it was the only row format available in InnoDB. From MySQL 5.0.3 to MySQL 5.7.8, the default row format is COMPACT. As of MySQL 5.7.9, the default row format is defined by the innodb_default_row_format configuration option, which has a default setting of DYNAMIC. You can still specify the REDUNDANT row format for compatibility with older InnoDB tables.

欲了解更多信息,请参见 第 17.10 节,“InnoDB 行格式”。For more information, see Section 17.10, “InnoDB Row Formats”.

另请参见 紧凑行格式、动态行格式、行格式。See Also compact row format, dynamic row format, row format.

参照完整性referential integrity

维持数据始终保持一致格式的技术,是ACID理念的一部分。特别地,通过使用外键约束来保持不同表中的数据一致性,这可以防止更改发生或自动将这些更改传播到所有相关表。相关机制包括唯一约束,它可以防止错误地插入重复值,以及非空约束,它可以防止错误地插入空值。 The technique of maintaining data always in a consistent format, part of the ACID philosophy. In particular, data in different tables is kept consistent through the use of foreign key constraints, which can prevent changes from happening or automatically propagate those changes to all related tables. Related mechanisms include the unique constraint, which prevents duplicate values from being inserted by mistake, and the NOT NULL constraint, which prevents blank values from being inserted by mistake.

另见 ACID、外键约束、非空约束、唯一约束。See Also ACID, FOREIGN KEY constraint, NOT NULL constraint, unique constraint.

关系型relational

现代数据库系统的一个重要方面。数据库服务器编码并强制执行一对一、一对多、多对一以及唯一性的关系。例如,在地址数据库中,一个人可能有零个、一个或多个电话号码;单个电话号码可能与多个家庭成员关联。在金融数据库中,一个人可能必须恰好拥有一个纳税人识别号,而且任何纳税人识别号只能与一个人关联。 An important aspect of modern database systems. The database server encodes and enforces relationships such as one-to-one, one-to-many, many-to-one, and uniqueness. For example, a person might have zero, one, or many phone numbers in an address database; a single phone number might be associated with several family members. In a financial database, a person might be required to have exactly one taxpayer ID, and any taxpayer ID could only be associated with one person.

数据库服务器可以利用这些关系来防止错误数据的插入,并找到高效的信息查询方式。例如,如果某个值被声明为唯一,服务器在找到第一个匹配项后就可以停止搜索,并且可以拒绝插入相同值的第二次尝试。The database server can use these relationships to prevent bad data from being inserted, and to find efficient ways to look up information. For example, if a value is declared to be unique, the server can stop searching as soon as the first match is found, and it can reject attempts to insert a second copy of the same value.

在数据库层面,这些关系通过 SQL 功能来表达,例如表中的 列、唯一和 NOT NULL 约束、外键 以及不同类型的连接操作。复杂关系通常涉及分散在多个表中的数据。通常,数据会被 规范化,以便在一对多关系中重复的值只存储一次。At the database level, these relationships are expressed through SQL features such as columns within a table, unique and NOT NULL constraints, foreign keys, and different kinds of join operations. Complex relationships typically involve data split between more than one table. Often, the data is normalized, so that duplicate values in one-to-many relationships are stored only once.

在数学语境中,数据库中的关系来源于集合论。例如,WHERE 子句中的 OR 和 AND 运算符表示并集和交集的概念。In a mathematical context, the relations within a database are derived from set theory. For example, the OR and AND operators of a WHERE clause represent the notions of union and intersection.

另请参见 ACID、列、约束、外键、规范化。See Also ACID, column, constraint, foreign key, normalized.

相关性relevance

在全文搜索功能中,数字表示搜索字符串与FULLTEXT 索引中数据的相似度。例如,当你搜索一个单词时,对于文本中该单词出现多次的行,它通常比只出现一次的行更相关。 In the full-text search feature, a number signifying the similarity between the search string and the data in the FULLTEXT index. For example, when you search for a single word, that word is typically more relevant for a row where it occurs several times in the text than a row where it appears only once.

另请参见 全文搜索,FULLTEXT 索引。See Also full-text search, FULLTEXT index.

可重复读(REPEATABLE READ)REPEATABLE READ

InnoDB 的默认 隔离级别。它防止被查询的任何行被其他 事务修改,从而阻止 不可重复读,但不能阻止 幻读。它使用适度严格的 锁定策略,以便事务中的所有查询都看到来自同一快照的数据,即事务开始时的数据。 The default isolation level for InnoDB. It prevents any rows that are queried from being changed by other transactions, thus blocking non-repeatable reads but not phantom reads. It uses a moderately strict locking strategy so that all queries within a transaction see data from the same snapshot, that is, the data as it was at the time the transaction started.

当一个具有该隔离级别的事务执行 UPDATE ... WHERE、DELETE ... WHERE、SELECT ... FOR UPDATE 和 LOCK IN SHARE MODE 操作时,其他事务可能需要等待。When a transaction with this isolation level performs UPDATE ... WHERE, DELETE ... WHERE, SELECT ... FOR UPDATE, and LOCK IN SHARE MODE operations, other transactions might have to wait.

SELECT ... FOR SHARE 在 MySQL 8.0.1 中取代了 SELECT ... LOCK IN SHARE MODE,但 LOCK IN SHARE MODE 仍可用于向后兼容。SELECT ... FOR SHARE replaces SELECT ... LOCK IN SHARE MODE in MySQL 8.0.1, but LOCK IN SHARE MODE remains available for backward compatibility.

另请参阅 ACID、一致性读取、隔离级别、锁定、幻影、事务。See Also ACID, consistent read, isolation level, locking, phantom, transaction.

字符集集repertoire

字符集集是应用于字符集的术语。字符集集是集合中字符的集合。参见 第 12.2.1 节,“字符集集”。 Repertoire is a term applied to character sets. A character set repertoire is the collection of characters in the set. See Section 12.2.1, “Character Set Repertoire”.

副本replica

在 复制 拓扑中,一台数据库 服务器 机器会从另一台服务器(源)接收更改并应用相同的更改。因此,它保持与源相同的内容,尽管可能会有一些延迟。 A database server machine in a replication topology that receives changes from another server (the source) and applies those same changes. Thus it maintains the same contents as the source, although it might lag somewhat behind.

在 MySQL 中,副本通常用于灾难恢复,以替代发生故障的源。它们也常用于测试软件升级和新设置,以确保数据库配置更改不会导致性能或可靠性问题。In MySQL, replicas are commonly used in disaster recovery, to take the place of a source that fails. They are also commonly used for testing software upgrades and new settings, to ensure that database configuration changes do not cause problems with performance or reliability.

副本通常负载较高,因为它们处理从源传来的所有DML(写入)操作,以及用户查询。为了确保副本能够足够快地应用源的更改,它们通常配备高速 I/O 设备,以及足够的 CPU 和内存,以在同一服务器上运行多个数据库实例。例如,源可能使用硬盘存储,而副本使用SSD。Replicas typically have high workloads, because they process all the DML (write) operations relayed from the source, as well as user queries. To ensure that replicas can apply changes from the source fast enough, they frequently have fast I/O devices and sufficient CPU and memory to run multiple database instances on the same server. For example, the source might use hard drive storage while the replicas use SSDs.

另请参阅 DML, 复制, 服务器, 源, SSD。See Also DML, replication, server, source, SSD.

复制replication

将更改从一个 源 发送到一个或多个 副本 的做法,以便所有数据库拥有相同的数据。这种技术有广泛的用途,例如负载均衡以提高可扩展性、灾难恢复,以及测试软件升级和配置更改。可以通过称为 基于行的复制 和 基于语句的复制 的方法在数据库之间发送这些更改。 The practice of sending changes from a source, to one or more replicas, so that all databases have the same data. This technique has a wide range of uses, such as load-balancing for better scalability, disaster recovery, and testing software upgrades and configuration changes. The changes can be sent between the databases by methods called row-based replication and statement-based replication.

另请参见 副本、基于行的复制、源、基于语句的复制。See Also replica, row-based replication, source, statement-based replication.

恢复restore

将一组来自 MySQL 企业备份 产品的备份文件放置到 MySQL 可用位置的过程。此操作可用于修复损坏的数据库、返回到某个较早的时间点,或(在 复制 环境中)设置新的 从库。在 MySQL 企业备份 产品中,此操作由 mysqlbackup 命令的 copy-back 选项执行。 The process of putting a set of backup files from the MySQL Enterprise Backup product in place for use by MySQL. This operation can be performed to fix a corrupted database, to return to some earlier point in time, or (in a replication context) to set up a new replica. In the MySQL Enterprise Backup product, this operation is performed by the copy-back option of the mysqlbackup command.

另请参见 热备份、MySQL 企业备份、mysqlbackup 命令、预备备份、副本、复制。See Also hot backup, MySQL Enterprise Backup, mysqlbackup command, prepared backup, replica, replication.

回滚rollback

一个 SQL 语句,用于结束一个 事务,撤销该事务所做的任何更改。它与 提交 相反,提交会使事务中所做的更改永久生效。 A SQL statement that ends a transaction, undoing any changes made by the transaction. It is the opposite of commit, which makes permanent any changes made in the transaction.

默认情况下,MySQL 使用 自动提交 设置,它会在每条 SQL 语句执行后自动执行一次提交。在使用回滚技术之前,必须更改此设置。By default, MySQL uses the autocommit setting, which automatically issues a commit following each SQL statement. You must change this setting before you can use the rollback technique.

另请参见 ACID, 自动提交, 提交, SQL, 事务。See Also ACID, autocommit, commit, SQL, transaction.

回滚段rollback segment

存储包含 撤销日志 的区域。回滚段传统上位于 系统表空间 中。从 MySQL 5.6 开始,回滚段可以位于 撤销表空间 中。从 MySQL 5.7 开始,回滚段也可以分配到 全局临时表空间。 The storage area containing the undo logs. Rollback segments have traditionally resided in the system tablespace. As of MySQL 5.6, rollback segments can reside in undo tablespaces. As of MySQL 5.7, rollback segments are also allocated to the global temporary tablespace.

另请参见 全局临时表空间、系统表空间、撤销日志、撤销表空间。See Also global temporary tablespace, system tablespace, undo log, undo tablespace.

行row

由一组 列 定义的逻辑数据结构。一组行组成一个 表。在 InnoDB 数据文件 中,每个 页 可以包含一行或多行。 The logical data structure defined by a set of columns. A set of rows makes up a table. Within InnoDB data files, each page can contain one or more rows.

尽管 InnoDB 使用 行格式 这一术语是为了与 MySQL 语法一致,但行格式是每个表的属性,并适用于该表中的所有行。Although InnoDB uses the term row format for consistency with MySQL syntax, the row format is a property of each table and applies to all rows in that table.

另请参见 列,数据文件,页,行格式,表。See Also column, data files, page, row format, table.

行格式row format

The disk storage format for 行数 of an InnoDB table. As InnoDB gains new capabilities such as compression, new row formats are introduced to support the resulting improvements in storage efficiency and performance. The disk storage format for rows of an InnoDB table. As InnoDB gains new capabilities such as compression, new row formats are introduced to support the resulting improvements in storage efficiency and performance.

InnoDB 表的行格式由 ROW_FORMAT 选项或 innodb_default_row_format 配置选项(自 MySQL 5.7.9 起引入)指定。行格式包括 REDUNDANT、COMPACT、COMPRESSED 和 DYNAMIC。要查看 InnoDB 表的行格式,请执行 SHOW TABLE STATUS 语句,或在 INFORMATION_SCHEMA 中查询 InnoDB 表的元数据。The row format of an InnoDB table is specified by the ROW_FORMAT option or by the innodb_default_row_format configuration option (introduced in MySQL 5.7.9). Row formats include REDUNDANT, COMPACT, COMPRESSED, and DYNAMIC. To view the row format of an InnoDB table, issue the SHOW TABLE STATUS statement or query InnoDB table metadata in the INFORMATION_SCHEMA.

另请参见 紧凑行格式,压缩行格式,压缩,动态行格式,冗余行格式,行,表。See Also compact row format, compressed row format, compression, dynamic row format, redundant row format, row, table.

行锁row lock

一种 锁,可以防止其他 事务以不兼容的方式访问某一行。其他同一表中的行可以被其他事务自由写入。这是 DML 操作在 InnoDB 表上执行的 锁定 类型。 A lock that prevents a row from being accessed in an incompatible way by another transaction. Other rows in the same table can be freely written to by other transactions. This is the type of locking done by DML operations on InnoDB tables.

与 表锁 形成对比,表锁用于 MyISAM,或用于在 InnoDB 表上进行 DDL 操作,而这些 DDL 操作无法通过 在线 DDL 完成;这些锁会阻止对表的并发访问。Contrast with table locks used by MyISAM, or during DDL operations on InnoDB tables that cannot be done with online DDL; those locks block concurrent access to the table.

另请参见 DDL、DML、InnoDB、锁、加锁、在线 DDL、表锁、事务。See Also DDL, DML, InnoDB, lock, locking, online DDL, table lock, transaction.

基于行的复制row-based replication

一种 复制 形式,其中事件从 源 传播,指定如何更改 副本 上的单行。对于 innodb_autoinc_lock_mode 选项的所有设置,此方法都是安全使用的。 A form of replication where events are propagated from the source specifying how to change individual rows on the replica. It is safe to use for all settings of the innodb_autoinc_lock_mode option.

另请参见 自增锁定、innodb_autoinc_lock_mode、副本、复制、源、基于语句的复制。See Also auto-increment locking, innodb_autoinc_lock_mode, replica, replication, source, statement-based replication.

行级锁定row-level locking

InnoDB 表使用的 锁定 机制依赖于 行级锁 而不是 表级锁。多个 事务 可以同时修改同一张表。只有当两个事务尝试修改同一行时,其中一个事务才会等待另一个事务完成(并释放其行锁)。 The locking mechanism used for InnoDB tables, relying on row locks rather than table locks. Multiple transactions can modify the same table concurrently. Only if two transactions try to modify the same row does one of the transactions wait for the other to complete (and release its row locks).

另请参阅 InnoDB、锁定、行锁、表锁、事务。See Also InnoDB, locking, row lock, table lock, transaction.

Ruby

一种强调动态类型和面向对象编程的编程语言。一些语法对 Perl 开发者来说很熟悉。 A programming language that emphasizes dynamic typing and object-oriented programming. Some syntax is familiar to Perl developers.

另请参见 API、Perl、Ruby API。See Also API, Perl, Ruby API.

Ruby API

mysql2,基于 libmysqlclient API 库,为开发 MySQL 应用的 Ruby 程序员提供。欲了解更多信息,请参见 第 31.11 节,“MySQL Ruby APIs”。 mysql2, based based on the libmysqlclient API library, is available for Ruby programmers developing MySQL applications. For more information, see Section 31.11, “MySQL Ruby APIs”.

另请参见 libmysql,Ruby。See Also libmysql, Ruby.

rw-lock(读写锁)rw-lock

低级对象,InnoDB用来表示并强制执行对内部内存数据结构的共享访问锁,遵循特定规则。与互斥锁(mutexes)形成对比,后者由InnoDB用来表示并强制执行对内部内存数据结构的独占访问。互斥锁和读写锁统称为闩锁。 The low-level object that InnoDB uses to represent and enforce shared-access locks to internal in-memory data structures following certain rules. Contrast with mutexes, which InnoDB uses to represent and enforce exclusive access to internal in-memory data structures. Mutexes and rw-locks are known collectively as latches.

rw-lock 类型包括 s-locks(共享锁)、x-locks(排他锁)和 sx-locks(共享-排他锁)。rw-lock types include s-locks (shared locks), x-locks (exclusive locks), and sx-locks (shared-exclusive locks).

  • s-lock 提供对公共资源的读取访问。An s-lock provides read access to a common resource.

  • x-lock 提供对公共资源的写入访问,同时不允许其他线程进行不一致的读取。An x-lock provides write access to a common resource while not permitting inconsistent reads by other threads.

  • sx-lock 提供对公共资源的写入访问,同时允许其他线程进行不一致的读取。sx-locks 在 MySQL 5.7 中引入,以优化并发性并改善读写工作负载的可扩展性。An sx-lock provides write access to a common resource while permitting inconsistent reads by other threads. sx-locks were introduced in MySQL 5.7 to optimize concurrency and improve scalability for read-write workloads.

下面的矩阵总结了 rw-lock 类型的兼容性。The following matrix summarizes rw-lock type compatibility.

S SX X
S 兼容Compatible 兼容Compatible 冲突Conflict
SX 兼容Compatible 冲突Conflict 冲突Conflict
X 冲突Conflict 冲突Conflict 冲突Conflict

另请参阅 闩锁、锁、互斥锁、性能模式。See Also latch, lock, mutex, Performance Schema.

SS

保存点savepoint

保存点有助于实现嵌套事务。它们可以用于为属于较大事务的一部分的表操作提供作用范围。例如,在预订系统中安排一次旅行可能涉及预订几次不同的航班;如果所需的航班不可用,你可能会回滚涉及预订该段航程的更改,而不会回滚之前成功预订的航班。 Savepoints help to implement nested transactions. They can be used to provide scope to operations on tables that are part of a larger transaction. For example, scheduling a trip in a reservation system might involve booking several different flights; if a desired flight is unavailable, you might roll back the changes involved in booking that one leg, without rolling back the earlier flights that were successfully booked.

另请参见 回滚, 事务。See Also rollback, transaction.

可扩展性scalability

在不因超过系统容量限制而导致性能突然下降的情况下,增加更多工作负载并发出更多请求到系统的能力。软件架构、硬件配置、应用程序编码以及工作负载类型都对可扩展性起作用。当系统达到最大容量时,提高可扩展性的常用技术有 纵向扩展(增加现有硬件或软件的容量)和 横向扩展(添加新的服务器和更多的 MySQL 实例)。通常与 可用性 搭配,作为大规模部署的关键方面。 The ability to add more work and issue more simultaneous requests to a system, without a sudden drop in performance due to exceeding the limits of system capacity. Software architecture, hardware configuration, application coding, and type of workload all play a part in scalability. When the system reaches its maximum capacity, popular techniques for increasing scalability are scale up (increasing the capacity of existing hardware or software) and scale out (adding new servers and more instances of MySQL). Often paired with availability as critical aspects of a large-scale deployment.

另请参阅 可用性、横向扩展、纵向扩展。See Also availability, scale out, scale up.

横向扩展scale out

通过增加新的服务器和更多的 MySQL 实例来提高可扩展性的技术。例如,设置复制、NDB 集群、连接池或其他将工作分散到一组服务器上的功能。与纵向扩展形成对比。 A technique for increasing scalability by adding new servers and more instances of MySQL. For example, setting up replication, NDB Cluster, connection pooling, or other features that spread work across a group of servers. Contrast with scale up.

另请参阅 可扩展性、纵向扩展。See Also scalability, scale up.

纵向扩展scale up

一种通过增加现有硬件或软件的容量来提高可扩展性的技术。例如,增加服务器的内存并调整与内存相关的参数,如 innodb_buffer_pool_size 和 innodb_buffer_pool_instances。与横向扩展形成对比。 A technique for increasing scalability by increasing the capacity of existing hardware or software. For example, increasing the memory on a server and adjusting memory-related parameters such as innodb_buffer_pool_size and innodb_buffer_pool_instances. Contrast with scale out.

另见 可扩展性, 横向扩展。See Also scalability, scale out.

模式schema

从概念上讲,模式是一组相互关联的数据库对象,例如表、表列、列的数据类型、索引、外键等等。这些对象通过 SQL 语法相互连接,因为列构成表,外键引用表和列,等等。理想情况下,它们在逻辑上也相互关联,共同作为统一应用或灵活框架的一部分工作。例如,INFORMATION_SCHEMA 和 performance_schema 数据库在其名称中使用 “schema”,以强调它们所包含的表和列之间的紧密关系。 Conceptually, a schema is a set of interrelated database objects, such as tables, table columns, data types of the columns, indexes, foreign keys, and so on. These objects are connected through SQL syntax, because the columns make up the tables, the foreign keys refer to tables and columns, and so on. Ideally, they are also connected logically, working together as part of a unified application or flexible framework. For example, the INFORMATION_SCHEMA and performance_schema databases use “schema” in their names to emphasize the close relationships between the tables and columns they contain.

在 MySQL 中,从物理上讲,模式 与 数据库 同义。你可以在 MySQL SQL 语法中用关键字 SCHEMA 替代 DATABASE,例如使用 CREATE SCHEMA 代替 CREATE DATABASE。In MySQL, physically, a schema is synonymous with a database. You can substitute the keyword SCHEMA instead of DATABASE in MySQL SQL syntax, for example using CREATE SCHEMA instead of CREATE DATABASE.

其他一些数据库产品则有所区分。例如,在 Oracle 数据库产品中,模式 仅表示数据库的一部分:单个用户拥有的表和其他对象。Some other database products draw a distinction. For example, in the Oracle Database product, a schema represents only a part of a database: the tables and other objects owned by a single user.

另见 数据库、INFORMATION_SCHEMA、性能模式。See Also database, INFORMATION_SCHEMA, Performance Schema.

SDI

缩写词,表示 “序列化字典信息”。 Acronym for “serialized dictionary information”.

另请参见 序列化字典信息 (SDI)。See Also serialized dictionary information (SDI).

搜索索引search index

在 MySQL 中,全文搜索 查询使用一种特殊类型的索引,即 FULLTEXT 索引。在 MySQL 5.6.4 及以上版本中,InnoDB 和 MyISAM 表都支持 FULLTEXT 索引;之前,这些索引仅可用于 MyISAM 表。 In MySQL, full-text search queries use a special kind of index, the FULLTEXT index. In MySQL 5.6.4 and up, InnoDB and MyISAM tables both support FULLTEXT indexes; formerly, these indexes were only available for MyISAM tables.

另请参见 全文搜索,FULLTEXT 索引。See Also full-text search, FULLTEXT index.

二级索引secondary index

一种 InnoDB 索引 类型,表示表列的一个子集。一个 InnoDB 表可以没有、只有一个或有多个二级索引。(与 聚簇索引 对比,每个 InnoDB 表都必须有聚簇索引,它存储表的所有列的数据。) A type of InnoDB index that represents a subset of table columns. An InnoDB table can have zero, one, or many secondary indexes. (Contrast with the clustered index, which is required for each InnoDB table, and stores the data for all the table columns.)

二级索引可用于满足仅需要索引列值的查询。对于更复杂的查询,它可以用来识别表中相关的行,然后通过使用聚簇索引的查找来检索这些行。A secondary index can be used to satisfy queries that only require values from the indexed columns. For more complex queries, it can be used to identify the relevant rows in the table, which are then retrieved through lookups using the clustered index.

创建和删除二级索引传统上涉及从 InnoDB 表中复制所有数据,这会产生大量开销。快速索引创建 功能使 CREATE INDEX 和 DROP INDEX 语句在 InnoDB 二级索引上执行速度更快。Creating and dropping secondary indexes has traditionally involved significant overhead from copying all the data in the InnoDB table. The fast index creation feature makes both CREATE INDEX and DROP INDEX statements much faster for InnoDB secondary indexes.

另请参见 聚簇索引、快速索引创建、索引。See Also clustered index, Fast Index Creation, index.

段segment

InnoDB 表空间中的一个分区。如果将表空间比作一个目录,那么段就类似于该目录中的文件。段可以增长,也可以创建新的段。 A division within an InnoDB tablespace. If a tablespace is analogous to a directory, the segments are analogous to files within that directory. A segment can grow. New segments can be created.

例如,在 每表文件 表空间中,表数据在一个段中,每个相关索引在它自己的段中。系统表空间 包含许多不同的段,因为它可以存放许多表及其相关索引。在 MySQL 8.0 之前,系统表空间还包括一个或多个用于 回滚段 的 撤销日志。For example, within a file-per-table tablespace, table data is in one segment and each associated index is in its own segment. The system tablespace contains many different segments, because it can hold many tables and their associated indexes. Prior to MySQL 8.0, the system tablespace also includes one or more rollback segments used for undo logs.

随着数据的插入和删除,段会增长和缩小。当一个段需要更多空间时,它会一次增加一个区段(1 兆字节)。类似地,当该区段中的所有数据不再需要时,段会释放相当于一个区段的空间。Segments grow and shrink as data is inserted and deleted. When a segment needs more room, it is extended by one extent (1 megabyte) at a time. Similarly, a segment releases one extent's worth of space when all the data in that extent is no longer needed.

另见 区段、每表文件、回滚段、系统表空间、表空间、回退日志。See Also extent, file-per-table, rollback segment, system tablespace, tablespace, undo log.

选择性selectivity

数据分布的一个属性,列中不同值的数量(其 基数)除以表中的记录数。高选择性意味着列值相对唯一,并且可以通过索引高效地检索。如果你(或查询优化器)能够预测 WHERE 子句中的测试只匹配表中的少量行(或比例),整体 查询如果首先评估该测试并使用索引,往往会更高效。 A property of data distribution, the number of distinct values in a column (its cardinality) divided by the number of records in the table. High selectivity means that the column values are relatively unique, and can retrieved efficiently through an index. If you (or the query optimizer) can predict that a test in a WHERE clause only matches a small number (or proportion) of rows in a table, the overall query tends to be efficient if it evaluates that test first, using an index.

另请参见 基数,查询。See Also cardinality, query.

半一致读semi-consistent read

一种用于 UPDATE 语句的读取操作类型,它是 READ COMMITTED 和 consistent read 的结合。当 UPDATE 语句检查已被锁定的行时,InnoDB 会将最新提交的版本返回给 MySQL,以便 MySQL 可以确定该行是否符合 UPDATE 的 WHERE 条件。如果该行匹配(必须更新),MySQL 会再次读取该行,这次 InnoDB 要么锁定它,要么等待对它的锁。这种类型的读取操作仅在事务具有 READ COMMITTED 隔离级别 时才会发生。 A type of read operation used for UPDATE statements, that is a combination of READ COMMITTED and consistent read. When an UPDATE statement examines a row that is already locked, InnoDB returns the latest committed version to MySQL so that MySQL can determine whether the row matches the WHERE condition of the UPDATE. If the row matches (must be updated), MySQL reads the row again, and this time InnoDB either locks it or waits for a lock on it. This type of read operation can only happen when the transaction has the READ COMMITTED isolation level.

另见 一致性读取,隔离级别,已提交读取(READ COMMITTED)。See Also consistent read, isolation level, READ COMMITTED.

可串行化(SERIALIZABLE)SERIALIZABLE

采用最保守锁策略的 隔离级别,在事务结束之前阻止任何其他 事务插入或修改该事务读取的数据。通过这种方式,相同的查询可以在事务中反复执行,并且每次都能确保检索到相同的数据集。任何尝试更改自当前事务开始以来已被其他事务提交的数据的行为,都会导致当前事务等待。 The isolation level that uses the most conservative locking strategy, to prevent any other transactions from inserting or changing data that was read by this transaction, until it is finished. This way, the same query can be run over and over within a transaction, and be certain to retrieve the same set of results each time. Any attempt to change data that was committed by another transaction since the start of the current transaction, cause the current transaction to wait.

这是 SQL 标准指定的默认隔离级别。在实际应用中,这种严格程度很少需要,因此 InnoDB 的默认隔离级别是下一个最严格的 可重复读(REPEATABLE READ)。This is the default isolation level specified by the SQL standard. In practice, this degree of strictness is rarely needed, so the default isolation level for InnoDB is the next most strict, REPEATABLE READ.

另请参见 ACID、一致性读取、隔离级别、锁定、可重复读(REPEATABLE READ)、事务。See Also ACID, consistent read, isolation level, locking, REPEATABLE READ, transaction.

序列化字典信息(SDI)serialized dictionary information (SDI)

以序列化形式存储的字典对象元数据。SDI 使用 JSON 格式存储。 Dictionary object metadata in serialized form. SDI is stored in JSON format.

从 MySQL 8.0.3 开始,除临时表空间和撤销表空间文件外,所有 InnoDB 表空间文件中都有 SDI。表空间文件中 SDI 的存在提供了元数据冗余。例如,如果数据字典不可用,可以使用 ibd2sdi 工具从表空间文件中提取字典对象元数据。As of MySQL 8.0.3, SDI is present in all InnoDB tablespace files except for temporary tablespace and undo tablespace files. The presence of SDI in tablespace files provides metadata redundancy. For example, dictionary object metadata can be extracted from tablespace files using the ibd2sdi utility if the data dictionary becomes unavailable.

对于 MyISAM 表,SDI 存储在模式目录中的 .sdi 元数据文件中。执行 IMPORT TABLE 操作需要 SDI 元数据文件。For a MyISAM table, SDI is stored in a .sdi metadata file in the schema directory. An SDI metadata file is required to perform an IMPORT TABLE operation.

另请参见 每表文件、通用表空间、系统表空间、表空间。See Also file-per-table, general tablespace, system tablespace, tablespace.

服务器server

一种持续运行的程序,等待接收并处理来自另一个程序(客户端)的请求。由于通常整个计算机都用于运行一个或多个服务器程序(例如数据库服务器、Web 服务器、应用服务器或它们的组合),因此术语 服务器 也可以指运行服务器软件的计算机。 A type of program that runs continuously, waiting to receive and act upon requests from another program (the client). Because often an entire computer is dedicated to running one or more server programs (such as a database server, a web server, an application server, or some combination of these), the term server can also refer to the computer that runs the server software.

另请参见 客户端,mysqld。See Also client, mysqld.

服务器端预处理语句server-side prepared statement

由 MySQL 服务器管理的 预处理语句。历史上,由于服务器端预处理语句存在问题,Connector/J 和 Connector/PHP 的开发人员有时会改用 客户端预处理语句。在现代 MySQL 服务器版本中,出于性能、可扩展性和内存效率的考虑,推荐使用服务器端预处理语句。 A prepared statement managed by the MySQL server. Historically, issues with server-side prepared statements led Connector/J and Connector/PHP developers to sometimes use client-side prepared statements instead. With modern MySQL server versions, server-side prepared statements are recommended for performance, scalability, and memory efficiency.

另请参见 客户端预处理语句、Connector/J、Connector/PHP、预处理语句。See Also client-side prepared statement, Connector/J, Connector/PHP, prepared statement.

服务主体名称service principal name

表示服务的 Kerberos 命名实体的名称。 The name for a Kerberos named entity that represents a service.

另请参见 主体。See Also principal.

服务票证service ticket

提供对应用服务(例如 Web 或数据库服务器提供的服务)访问权限的 Kerberos 票证。 A Kerberos ticket that provides access to an application service, such as the service provided by a web or database server.

servlet

另请参阅 Connector/J。See Also Connector/J.

会话临时表空间session temporary tablespace

一个临时表空间,用于存储用户创建的临时表以及在将InnoDB配置为内部临时表的磁盘存储引擎时,由优化器创建的内部临时表。 A temporary tablespace that stores user-created temporary tables and internal temporary tables created by the optimizer when InnoDB is configured as the on-disk storage engine for internal temporary tables.

另请参见 优化器、临时表、临时表空间。See Also optimizer, temporary table, temporary tablespace.

共享锁shared lock

一种锁,允许其他事务读取被锁定的对象,并且也可以在其上获得其他共享锁,但不能对其进行写操作。与排他锁相反。 A kind of lock that allows other transactions to read the locked object, and to also acquire other shared locks on it, but not to write to it. The opposite of exclusive lock.

另请参阅 排他锁,锁,事务。See Also exclusive lock, lock, transaction.

共享表空间shared tablespace

指代 系统表空间 或 通用表空间 的另一种方式。通用表空间是在 MySQL 5.7 中引入的。多个表可以存放在共享表空间中。只有单个表可以存放在 每表单文件 表空间中。 Another way of referring to the system tablespace or a general tablespace. General tablespaces were introduced in MySQL 5.7. More than one table can reside in a shared tablespace. Only a single table can reside in a file-per-table tablespace.

另请参见 通用表空间、系统表空间。See Also general tablespace, system tablespace.

sharp checkpoint

The process of flushing to disk all dirty buffer pool pages whose redo entries are contained in certain portion of the redo log. Occurs before InnoDB reuses a portion of a log file; the log files are used in a circular fashion. Typically occurs with write-intensive workloads.

另请参见 脏页、刷新、重做日志、工作负载。See Also dirty page, flush, redo log, workload.

关闭shutdown

停止 MySQL 服务器的过程。默认情况下,此过程会清理 InnoDB 表的操作,因此 InnoDB 关闭可能会比较 慢,但之后启动速度快。如果跳过清理操作,关闭会很 快,但清理必须在下一次重启时进行。 The process of stopping the MySQL server. By default, this process cleans up operations for InnoDB tables, so InnoDB can be slow to shut down, but fast to start up later. If you skip the cleanup operations, it is fast to shut down but the cleanup must be performed during the next restart.

InnoDB 的关闭模式由 innodb_fast_shutdown 选项控制。The shutdown mode for InnoDB is controlled by the innodb_fast_shutdown option.

另见 快速关闭,InnoDB,缓慢关闭,启动。See Also fast shutdown, InnoDB, slow shutdown, startup.

从属服务器slave

参见 副本。See replica.

慢查询日志slow query log

一种用于 MySQL 服务器处理的 SQL 语句性能调优的 日志 类型。日志信息存储在文件中。您必须启用此功能才能使用它。您可以控制哪些类别的 “慢” SQL 语句被记录。有关更多信息,请参见 第 7.4.5 节,“慢查询日志”。 A type of log used for performance tuning of SQL statements processed by the MySQL server. The log information is stored in a file. You must enable this feature to use it. You control which categories of “slow” SQL statements are logged. For more information, see Section 7.4.5, “The Slow Query Log”.

另请参见 通用查询日志, 日志。See Also general query log, log.

慢关闭slow shutdown

一种在完成之前执行额外 InnoDB 刷写操作的 关闭 类型。也称为 干净关闭。由配置参数 innodb_fast_shutdown=0 或命令 SET GLOBAL innodb_fast_shutdown=0; 指定。虽然关闭本身可能需要更长时间,但应能在后续启动时节省时间。 A type of shutdown that does additional InnoDB flushing operations before completing. Also known as a clean shutdown. Specified by the configuration parameter innodb_fast_shutdown=0 or the command SET GLOBAL innodb_fast_shutdown=0;. Although the shutdown itself can take longer, that time should be saved on the subsequent startup.

另见 干净关闭、快速关闭、关闭。See Also clean shutdown, fast shutdown, shutdown.

快照snapshot

在特定时间点的表示,即使其他事务提交了更改,它仍然保持不变。某些隔离级别使用它来允许一致性读取。 A representation of data at a particular time, which remains the same even as changes are committed by other transactions. Used by certain isolation levels to allow consistent reads.

另见 提交,一致性读取,隔离级别,事务。See Also commit, consistent read, isolation level, transaction.

排序缓冲区sort buffer

在创建 InnoDB 索引时用于排序数据的缓冲区。排序缓冲区大小通过 innodb_sort_buffer_size 配置选项进行配置。 The buffer used for sorting data during creation of an InnoDB index. Sort buffer size is configured using the innodb_sort_buffer_size configuration option.

源source

在 复制 场景中,处理数据的初始插入、更新和删除请求的数据库服务器机器。这些更改会传递并在其他称为 副本 的服务器上重复执行。 A database server machine in a replication scenario that processes the initial insert, update, and delete requests for data. These changes are propagated to, and repeated on, other servers known as replicas.

另见 副本,复制。See Also replica, replication.

空间 IDspace ID

用于在 MySQL 实例中唯一标识 InnoDB 表空间 的标识符。系统表空间 的空间 ID 始终为零;这个相同的 ID 适用于系统表空间或通用表空间内的所有表。每个 每表文件 表空间和 通用表空间 都有自己的空间 ID。 An identifier used to uniquely identify an InnoDB tablespace within a MySQL instance. The space ID for the system tablespace is always zero; this same ID applies to all tables within the system tablespace or within a general tablespace. Each file-per-table tablespace and general tablespace has its own space ID.

在 MySQL 5.6 之前,这个硬编码的值在在 MySQL 实例之间移动 InnoDB 表空间文件时会带来困难。从 MySQL 5.6 开始,可以使用 可传输表空间 功能,通过使用语句 FLUSH TABLES ... FOR EXPORT、ALTER TABLE ... DISCARD TABLESPACE 和 ALTER TABLE ... IMPORT TABLESPACE 在实例之间复制表空间文件。调整空间 ID 所需的信息包含在与表空间一起复制的 .cfg 文件 中。详情请参见 第 17.6.1.3 节,“导入 InnoDB 表”。Prior to MySQL 5.6, this hardcoded value presented difficulties in moving InnoDB tablespace files between MySQL instances. Starting in MySQL 5.6, you can copy tablespace files between instances by using the transportable tablespace feature involving the statements FLUSH TABLES ... FOR EXPORT, ALTER TABLE ... DISCARD TABLESPACE, and ALTER TABLE ... IMPORT TABLESPACE. The information needed to adjust the space ID is conveyed in the .cfg file which you copy along with the tablespace. See Section 17.6.1.3, “Importing InnoDB Tables” for details.

另请参阅 .cfg 文件、每表文件、通用表空间、.ibd 文件、系统表空间、表空间、可移植表空间。See Also .cfg file, file-per-table, general tablespace, .ibd file, system tablespace, tablespace, transportable tablespace.

稀疏文件sparse file

一种通过将表示空块的元数据写入磁盘而不是写入实际空空间,更高效地使用文件系统空间的文件类型。InnoDB 透明页压缩 功能依赖于稀疏文件支持。更多信息,请参见 第 17.9.2 节,“InnoDB 页压缩”。 A type of file that uses file system space more efficiently by writing metadata representing empty blocks to disk instead of writing the actual empty space. The InnoDB transparent page compression feature relies on sparse file support. For more information, see Section 17.9.2, “InnoDB Page Compression”.

另请参见 打孔,透明页压缩。See Also hole punching, transparent page compression.

旋转spin

一种等待操作,它会持续测试某个资源是否可用。这种技术用于通常只被占用短时间的资源,在这种情况下,在“忙循环”中等待比让线程休眠并进行上下文切换更高效。如果资源在短时间内未变得可用,旋转循环将停止并使用另一种等待技术。 A type of wait operation that continuously tests whether a resource becomes available. This technique is used for resources that are typically held only for brief periods, where it is more efficient to wait in a “busy loop” than to put the thread to sleep and perform a context switch. If the resource does not become available within a short time, the spin loop ceases and another wait technique is used.

另请参见 闩锁、锁、互斥锁、等待。See Also latch, lock, mutex, wait.

SPN

参见 服务主体名称。See service principal name.

Spring

一个基于 Java 的应用框架,旨在通过提供配置组件的方式来辅助应用设计。 A Java-based application framework designed for assisting in application design by providing a way to configure components.

参见 J2EE。See Also J2EE.

SQL

用于执行数据库操作的标准结构化查询语言。通常分为 DDL、DML 和 查询 类别。MySQL 包括一些额外的语句类别,如 复制。有关 SQL 语法构建块,请参见 第 11 章, 语言结构;有关用于 MySQL 表列的数据类型,请参见 第 13 章, 数据类型;有关 SQL 语句及其相关类别的详细信息,请参见 第 15 章, SQL 语句;有关查询中可使用的标准和 MySQL 特定函数,请参见 第 14 章, 函数和操作符。 The Structured Query Language that is standard for performing database operations. Often divided into the categories DDL, DML, and queries. MySQL includes some additional statement categories such as replication. See Chapter 11, Language Structure for the building blocks of SQL syntax, Chapter 13, Data Types for the data types to use for MySQL table columns, Chapter 15, SQL Statements for details about SQL statements and their associated categories, and Chapter 14, Functions and Operators for standard and MySQL-specific functions to use in queries.

另请参阅 DDL、DML、查询、复制。See Also DDL, DML, query, replication.

SQLState

由 JDBC 标准定义的错误代码,用于使用 Connector/J 的应用程序的异常处理。 An error code defined by the JDBC standard, for exception handling by applications using Connector/J.

另请参阅 Connector/J、JDBC。See Also Connector/J, JDBC.

SSD

Acronym for “solid-state drive”. A type of storage device with different performance characteristics than a traditional hard disk drive (HDD): smaller storage capacity, faster for random reads, no moving parts, and with a number of considerations affecting write performance. Its performance characteristics can influence the throughput of a disk-bound workload.

另见 磁盘限制, HDD。See Also disk-bound, HDD.

SSL

Acronym for “secure sockets layer”. Provides the encryption layer for network communication between an application and a MySQL database server.

另请参见 密钥库、信任库。See Also keystore, truststore.

ST

参见 服务票据。See service ticket.

启动startup

启动 MySQL 服务器的过程。通常由 第 6.3 节,“服务器及服务器启动程序” 中列出的某个程序执行。与 shutdown 相反。 The process of starting the MySQL server. Typically done by one of the programs listed in Section 6.3, “Server and Server-Startup Programs”. The opposite of shutdown.

另请参见 关闭。See Also shutdown.

语句拦截器statement interceptor

一种用于跟踪、调试或增强数据库应用程序发出的 SQL 语句的 拦截器 类型。有时也称为 命令拦截器。 A type of interceptor for tracing, debugging, or augmenting SQL statements issued by a database application. Sometimes also known as a command interceptor.

在使用 Connector/J 的 Java 应用程序中,设置这种类型的拦截器涉及实现 com.mysql.jdbc.StatementInterceptorV2 接口,并在 连接字符串 中添加 statementInterceptors 属性。In Java applications using Connector/J, setting up this type of interceptor involves implementing the com.mysql.jdbc.StatementInterceptorV2 interface, and adding a statementInterceptors property to the connection string.

在使用 Connector/NET 的 Visual Studio 应用程序中,设置这种类型的拦截器涉及定义一个继承自 BaseCommandInterceptor 类的类,并在连接字符串中指定该类名。In Visual Studio applications using Connector/NET, setting up this type of interceptor involves defining a class that inherits from the BaseCommandInterceptor class and specifying that class name as part of the connection string.

另请参见 命令拦截器、连接字符串、Connector/J、Connector/NET、拦截器、Java、Visual Studio。See Also command interceptor, connection string, Connector/J, Connector/NET, interceptor, Java, Visual Studio.

基于语句的复制statement-based replication

一种 复制 形式,其中 SQL 语句从 源 发送并在 副本 上重放。需要注意 innodb_autoinc_lock_mode 选项的设置,以避免与 自增锁定 相关的潜在时间问题。 A form of replication where SQL statements are sent from the source and replayed on the replica. It requires some care with the setting for the innodb_autoinc_lock_mode option, to avoid potential timing problems with auto-increment locking.

另请参见 自增锁定,innodb_autoinc_lock_mode,副本,复制,基于行的复制,源。See Also auto-increment locking, innodb_autoinc_lock_mode, replica, replication, row-based replication, source.

统计信息statistics

与每个 InnoDB 表 和 索引 相关的估计值,用于构建高效的 查询执行计划。主要的值是 基数(不同值的数量)以及表行或索引条目的总数。表的统计信息表示其 主键 索引中的数据。辅助索引 的统计信息表示该索引所覆盖的行。 Estimated values relating to each InnoDB table and index, used to construct an efficient query execution plan. The main values are the cardinality (number of distinct values) and the total number of table rows or index entries. The statistics for the table represent the data in its primary key index. The statistics for a secondary index represent the rows covered by that index.

这些值是估计的,而不是精确计数的,因为在任何时刻,不同的事务可能会在同一个表中插入和删除行。为了避免值被频繁重新计算,您可以启用持久统计,其中值存储在InnoDB系统表中,并且仅在您执行ANALYZE TABLE语句时刷新。The values are estimated rather than counted precisely because at any moment, different transactions can be inserting and deleting rows from the same table. To keep the values from being recalculated frequently, you can enable persistent statistics, where the values are stored in InnoDB system tables, and refreshed only when you issue an ANALYZE TABLE statement.

您可以通过innodb_stats_method配置选项控制在计算统计信息时如何处理NULL值。You can control how NULL values are treated when calculating statistics through the innodb_stats_method configuration option.

数据库对象和数据库活动的其他类型统计信息可以通过 INFORMATION_SCHEMA 和 PERFORMANCE_SCHEMA 表获得。Other types of statistics are available for database objects and database activity through the INFORMATION_SCHEMA and PERFORMANCE_SCHEMA tables.

另请参见 基数、索引、INFORMATION_SCHEMA、NULL、性能模式、持久性统计、主键、查询执行计划、辅助索引、表、事务。See Also cardinality, index, INFORMATION_SCHEMA, NULL, Performance Schema, persistent statistics, primary key, query execution plan, secondary index, table, transaction.

词干提取stemming

根据共同的词根搜索单词的不同变体的能力,例如单数和复数,或者动词的过去、现在和将来时。这一功能目前在 MyISAM 全文搜索 功能中得到支持,但在 InnoDB 表的 InnoDB 中不支持。 The ability to search for different variations of a word based on a common root word, such as singular and plural, or past, present, and future verb tense. This feature is currently supported in MyISAM full-text search feature but not in FULLTEXT indexes for InnoDB tables.

另请参见 全文搜索,FULLTEXT 索引。See Also full-text search, FULLTEXT index.

停用词stopword

在 全文索引 中,如果一个词被认为是常见或无关紧要的,它会被从 搜索索引 中省略,并在搜索查询中被忽略。不同的配置设置控制 InnoDB 和 MyISAM 表的停用词处理。详情请参见 第 14.9.4 节,“全文停用词”。 In a FULLTEXT index, a word that is considered common or trivial enough that it is omitted from the search index and ignored in search queries. Different configuration settings control stopword processing for InnoDB and MyISAM tables. See Section 14.9.4, “Full-Text Stopwords” for details.

另请参见 全文索引、搜索索引。See Also FULLTEXT index, search index.

存储引擎storage engine

MySQL 数据库的一个组件,执行存储、更新和查询数据的底层工作。在 MySQL 5.5 及更高版本中,InnoDB 是新表的默认存储引擎,取代了 MyISAM。不同的存储引擎在内存使用与磁盘使用、读取速度与写入速度、速度与稳健性等因素上有不同的权衡。每个存储引擎管理特定的表,因此我们称之为 InnoDB 表、MyISAM 表,等等。 A component of the MySQL database that performs the low-level work of storing, updating, and querying data. In MySQL 5.5 and higher, InnoDB is the default storage engine for new tables, superceding MyISAM. Different storage engines are designed with different tradeoffs between factors such as memory usage versus disk usage, read speed versus write speed, and speed versus robustness. Each storage engine manages specific tables, so we refer to InnoDB tables, MyISAM tables, and so on.

MySQL 企业备份 产品针对备份 InnoDB 表进行了优化。它也可以备份由 MyISAM 和其他存储引擎处理的表。The MySQL Enterprise Backup product is optimized for backing up InnoDB tables. It can also back up tables handled by MyISAM and other storage engines.

另请参见 InnoDB,MySQL 企业备份,表类型。See Also InnoDB, MySQL Enterprise Backup, table type.

存储生成列stored generated column

列的值是根据列定义中包含的表达式计算的。在插入或更新行时,列值会被评估并存储。存储生成列需要存储空间,并且可以建立索引。 A column whose values are computed from an expression included in the column definition. Column values are evaluated and stored when rows are inserted or updated. A stored generated column requires storage space and can be indexed.

与 虚拟生成列 对比。Contrast with virtual generated column.

另请参见 基本列、生成列、虚拟生成列。See Also base column, generated column, virtual generated column.

存储对象stored object

一个存储程序或视图。 A stored program or view.

存储程序stored program

一个存储的例程(过程或函数)、触发器或事件调度器事件。 A stored routine (procedure or function), trigger, or Event Scheduler event.

存储例程stored routine

一个存储的过程或函数。 A stored procedure or function.

严格模式strict mode

由 innodb_strict_mode 选项控制的设置的一般名称。打开此设置会导致通常被视为警告的某些情况被视为错误。例如,与 文件格式 和 行格式 相关的某些无效选项组合,通常会产生警告并继续使用默认值,现在会导致 CREATE TABLE 操作失败。innodb_strict_mode 在 MySQL 5.7 中默认启用。 The general name for the setting controlled by the innodb_strict_mode option. Turning on this setting causes certain conditions that are normally treated as warnings, to be considered errors. For example, certain invalid combinations of options related to file format and row format, that normally produce a warning and continue with default values, now cause the CREATE TABLE operation to fail. innodb_strict_mode is enabled by default in MySQL 5.7.

MySQL 也有一种称为严格模式的设置。参见 第 7.1.11 节,“服务器 SQL 模式”。MySQL also has something called strict mode. See Section 7.1.11, “Server SQL Modes”.

另请参见 文件格式、innodb_strict_mode、行格式。See Also file format, innodb_strict_mode, row format.

子列表sublist

在表示 缓冲池 的列表结构中,相对较旧和相对较新的页面由 列表 的不同部分表示。一组参数控制这些部分的大小以及新旧页面之间的分界点。 Within the list structure that represents the buffer pool, pages that are relatively old and relatively new are represented by different portions of the list. A set of parameters control the size of these portions and the dividing point between the new and old pages.

另请参见 缓冲池,驱逐,列表,LRU。See Also buffer pool, eviction, list, LRU.

上确界记录supremum record

索引中的一个 伪记录,表示该索引中最大值之上的 空隙。如果一个事务有这样的语句 SELECT ... FROM ... WHERE col > 10 FOR UPDATE;,而该列中的最大值是 20,那么这是对上确界记录的锁,防止其他事务插入更大的值,例如 50、100 等等。 A pseudo-record in an index, representing the gap above the largest value in that index. If a transaction has a statement such as SELECT ... FROM ... WHERE col > 10 FOR UPDATE;, and the largest value in the column is 20, it is a lock on the supremum record that prevents other transactions from inserting even larger values such as 50, 100, and so on.

另见 缺口,下确界记录,伪记录。See Also gap, infimum record, pseudo-record.

代理键surrogate key

合成键 的同义词名称。 Synonym name for synthetic key.

另见 合成键。See Also synthetic key.

合成键synthetic key

一个索引列,通常是 主键,其值是任意分配的。通常使用 自增 列来实现。通过将值视为完全任意,可以避免过于严格的规则和错误的应用假设。例如,表示员工编号的数字序列可能存在空缺,如果某位员工被批准聘用但实际上未加入公司。或者,员工编号 100 的入职日期可能晚于员工编号 500,如果他们曾离开公司后来又重新加入。数字值还可以生成长度可预测的较短值。例如,存储表示 “路”、“大道”、“高速公路” 等含义的数字代码,比反复存储这些字符串更节省空间。 An indexed column, typically a primary key, where the values are assigned arbitrarily. Often done using an auto-increment column. By treating the value as completely arbitrary, you can avoid overly restrictive rules and faulty application assumptions. For example, a numeric sequence representing employee numbers might have a gap if an employee was approved for hiring but never actually joined. Or employee number 100 might have a later hiring date than employee number 500, if they left the company and later rejoined. Numeric values also produce shorter values of predictable length. For example, storing numeric codes meaning “Road”, “Boulevard”, “Expressway”, and so on is more space-efficient than repeating those strings over and over.

也称为 替代键。与 自然键 对比。Also known as a surrogate key. Contrast with natural key.

另请参阅 自增,自然键,主键,替代键。See Also auto-increment, natural key, primary key, surrogate key.

系统表空间system tablespace

一个或多个数据文件(ibdata 文件),包含 InnoDB 相关对象的元数据,以及 变更缓冲区 和 双写缓冲区 的存储区域。如果表是在系统表空间中创建的,而不是在 每表文件 或 通用表空间 中,它也可能包含 InnoDB 表的表和索引数据。系统表空间中的数据和元数据适用于 MySQL 实例 中的所有 数据库。 One or more data files (ibdata files) containing the metadata for InnoDB-related objects, and the storage areas for the change buffer, and the doublewrite buffer. It may also contain table and index data for InnoDB tables if tables were created in the system tablespace instead of file-per-table or general tablespaces. The data and metadata in the system tablespace apply to all databases in a MySQL instance.

在 MySQL 5.6.7 之前,默认情况下会将所有 InnoDB 表和索引保存在系统表空间内,这通常会导致该文件变得非常大。由于系统表空间从不缩小,如果加载大量临时数据后再删除,可能会引发存储问题。在 MySQL 8.0 中,默认设置为 每表文件 模式,其中每个表及其相关索引都存储在单独的 .ibd 文件 中。这个默认设置使使用依赖 DYNAMIC 和 COMPRESSED 行格式的 InnoDB 功能变得更加容易,例如表 压缩、页外列 的高效存储以及大型索引键前缀。Prior to MySQL 5.6.7, the default was to keep all InnoDB tables and indexes inside the system tablespace, often causing this file to become very large. Because the system tablespace never shrinks, storage problems could arise if large amounts of temporary data were loaded and then deleted. In MySQL 8.0, the default is file-per-table mode, where each table and its associated indexes are stored in a separate .ibd file. This default makes it easier to use InnoDB features that rely on DYNAMIC and COMPRESSED row formats, such as table compression, efficient storage of off-page columns, and large index key prefixes.

将所有表数据保存在系统表空间中或单独的 .ibd 文件中,对存储管理总体上都有影响。MySQL 企业备份 产品可能会备份少量大型文件,也可能备份许多较小的文件。在拥有数千个表的系统中,处理数千个 .ibd 文件的文件系统操作可能会造成瓶颈。Keeping all table data in the system tablespace or in separate .ibd files has implications for storage management in general. The MySQL Enterprise Backup product might back up a small set of large files, or many smaller files. On systems with thousands of tables, the file system operations to process thousands of .ibd files can cause bottlenecks.

InnoDB 在 MySQL 5.7.6 中引入了通用表空间,它们也以 .ibd 文件形式存在。通用表空间是使用 CREATE TABLESPACE 语法创建的共享表空间。它们可以创建在数据目录之外,能够存放多个表,并支持所有行格式的表。InnoDB introduced general tablespaces in MySQL 5.7.6, which are also represented by .ibd files. General tablespaces are shared tablespaces created using CREATE TABLESPACE syntax. They can be created outside of the data directory, are capable of holding multiple tables, and support tables of all row formats.

另请参阅 更改缓冲区、压缩、数据字典、数据库、双写缓冲区、动态行格式、每表文件、通用表空间、.ibd 文件、ibdata 文件、innodb_file_per_table、实例、MySQL 企业备份、页外列、表空间、回滚日志。See Also change buffer, compression, data dictionary, database, doublewrite buffer, dynamic row format, file-per-table, general tablespace, .ibd file, ibdata file, innodb_file_per_table, instance, MySQL Enterprise Backup, off-page column, tablespace, undo log.

TT

表table

每个 MySQL 表都与特定的 存储引擎 相关联。InnoDB 表具有特定的 物理 和 逻辑 特性,这些特性会影响性能、扩展性、备份、管理以及应用开发。 Each MySQL table is associated with a particular storage engine. InnoDB tables have particular physical and logical characteristics that affect performance, scalability, backup, administration, and application development.

在文件存储方面,InnoDB 表属于以下表空间类型之一:In terms of file storage, an InnoDB table belongs to one of the following tablespace types:

  • 共享的 InnoDB 系统表空间,由一个或多个 ibdata 文件 组成。The shared InnoDB system tablespace, which is comprised of one or more ibdata files.

  • 一个 每表一个文件 表空间,由单个 .ibd 文件 组成。A file-per-table tablespace, comprised of an individual .ibd file.

  • 一个共享的 通用表空间,由单个 .ibd 文件组成。通用表空间在 MySQL 5.7.6 中引入。A shared general tablespace, comprised of an individual .ibd file. General tablespaces were introduced in MySQL 5.7.6.

.ibd 数据文件包含表和 索引 数据。.ibd data files contain both table and index data.

InnoDB 在文件-每表表空间中创建的表可以使用 DYNAMIC 或 COMPRESSED 行格式。这些行格式启用 InnoDB 功能,例如 压缩、高效存储 页外列 以及大型索引键前缀。通用表空间支持所有行格式。InnoDB tables created in file-per-table tablespaces can use DYNAMIC or COMPRESSED row format. These row formats enable InnoDB features such as compression, efficient storage of off-page columns, and large index key prefixes. General tablespaces support all row formats.

系统表空间支持使用 REDUNDANT、COMPACT 和 DYNAMIC 行格式的表。系统表空间对 DYNAMIC 行格式的支持是在 MySQL 5.7.6 中添加的。The system tablespace supports tables that use REDUNDANT, COMPACT, and DYNAMIC row formats. System tablespace support for the DYNAMIC row format was added in MySQL 5.7.6.

该行数 of an InnoDB table are organized into an index structure known as the clustered index, with entries sorted based on the primary key columns of the table. Data access is optimized for queries that filter and sort on the primary key columns, and each index contains a copy of the associated primary key columns for each entry. Modifying values for any of the primary key columns is an expensive operation. Thus an important aspect of InnoDB table design is choosing a primary key with columns that are used in the most important queries, and keeping the primary key short, with rarely changing values.The rows of an InnoDB table are organized into an index structure known as the clustered index, with entries sorted based on the primary key columns of the table. Data access is optimized for queries that filter and sort on the primary key columns, and each index contains a copy of the associated primary key columns for each entry. Modifying values for any of the primary key columns is an expensive operation. Thus an important aspect of InnoDB table design is choosing a primary key with columns that are used in the most important queries, and keeping the primary key short, with rarely changing values.

另请参阅 备份、聚集索引、紧凑行格式、压缩行格式、压缩、动态行格式、快速索引创建、每表文件、.ibd 文件、索引、页外列、主键、冗余行格式、行、系统表空间、表空间。See Also backup, clustered index, compact row format, compressed row format, compression, dynamic row format, Fast Index Creation, file-per-table, .ibd file, index, off-page column, primary key, redundant row format, row, system tablespace, tablespace.

表锁table lock

一种锁,防止任何其他 事务 访问表。InnoDB 通过使用诸如 在线 DDL、行锁 和 一致性读取 等技术来处理 DML 语句和 查询,从而尽量避免使用这种锁。你可以通过 SQL 使用 LOCK TABLE 语句创建这种锁;从其他数据库系统或 MySQL 存储引擎迁移的一个步骤是在实际可行的情况下移除这些语句。 A lock that prevents any other transaction from accessing a table. InnoDB makes considerable effort to make such locks unnecessary, by using techniques such as online DDL, row locks and consistent reads for processing DML statements and queries. You can create such a lock through SQL using the LOCK TABLE statement; one of the steps in migrating from other database systems or MySQL storage engines is to remove such statements wherever practical.

另请参见 一致性读,DML,锁,加锁,在线 DDL,查询,行锁,表,事务。See Also consistent read, DML, lock, locking, online DDL, query, row lock, table, transaction.

表扫描table scan

参见 全表扫描。See full table scan.

表统计table statistics

参见 统计信息。See statistics.

表类型table type

已废弃的 存储引擎 同义词。我们通常提到 InnoDB 表、MyISAM 表,等等。 Obsolete synonym for storage engine. We refer to InnoDB tables, MyISAM tables, and so on.

另请参阅 InnoDB、存储引擎。See Also InnoDB, storage engine.

表空间tablespace

一个数据文件,可以存储一个或多个 InnoDB 表 及相关的 索引。 A data file that can hold data for one or more InnoDB tables and associated indexes.

系统表空间 包含 InnoDB 数据字典,在 MySQL 5.6 之前默认存储所有其他 InnoDB 表。The system tablespace contains the InnoDB data dictionary, and prior to MySQL 5.6 holds all other InnoDB tables by default.

innodb_file_per_table 选项在 MySQL 5.6 及以上版本中默认启用,允许表创建在自己的表空间中。每表文件表空间支持诸如高效存储页外列、表压缩以及可移动表空间等功能。详情参见第 17.6.3.2 节,“每表文件表空间”。The innodb_file_per_table option, enabled by default in MySQL 5.6 and higher, allows tables to be created in their own tablespaces. File-per-table tablespaces support features such as efficient storage of off-page columns, table compression, and transportable tablespaces. See Section 17.6.3.2, “File-Per-Table Tablespaces” for details.

InnoDB 在 MySQL 5.7.6 中引入了通用表空间。通用表空间是使用 CREATE TABLESPACE 语法创建的共享表空间。它们可以创建在 MySQL 数据目录之外,能够容纳多个表,并且支持所有行格式的表。InnoDB introduced general tablespaces in MySQL 5.7.6. General tablespaces are shared tablespaces created using CREATE TABLESPACE syntax. They can be created outside of the MySQL data directory, are capable of holding multiple tables, and support tables of all row formats.

MySQL NDB Cluster 也将其表分组到表空间中。详情请参见 第 25.6.11.1 节,“NDB Cluster 磁盘数据对象”。MySQL NDB Cluster also groups its tables into tablespaces. See Section 25.6.11.1, “NDB Cluster Disk Data Objects” for details.

另请参见 压缩行格式,数据字典,数据文件,每表文件,通用表空间,索引,innodb_file_per_table,系统表空间,表。See Also compressed row format, data dictionary, data files, file-per-table, general tablespace, index, innodb_file_per_table, system tablespace, table.

Tcl

一种起源于 Unix 脚本世界的编程语言。有时通过用 C、C 或 Java 编写的代码进行扩展。关于 MySQL 的开源 Tcl API,请参见 第 31.12 节,“MySQL Tcl API”。 A programming language originating in the Unix scripting world. Sometimes extended by code written in C, C++, or Java. For the open-source Tcl API for MySQL, see Section 31.12, “MySQL Tcl API”.

另请参见 API。See Also API.

临时表temporary table

一个表,其数据不需要真正永久保存。例如,临时表可以用作复杂计算或转换中间结果的存储区域;这些中间数据在系统崩溃后不需要恢复。数据库产品可以采取各种捷径来提高临时表操作的性能,例如在写入数据到磁盘和采取其他措施以在重启时保护数据方面不那么严格。 A table whose data does not need to be truly permanent. For example, temporary tables might be used as storage areas for intermediate results in complicated calculations or transformations; this intermediate data would not need to be recovered after a crash. Database products can take various shortcuts to improve the performance of operations on temporary tables, by being less scrupulous about writing data to disk and other measures to protect the data across restarts.

有时,数据本身会在设定时间自动删除,例如在事务结束或会话结束时。对于一些数据库产品,表本身也会自动被删除。Sometimes, the data itself is removed automatically at a set time, such as when the transaction ends or when the session ends. With some database products, the table itself is removed automatically too.

另请参见 表。See Also table.

临时表空间temporary tablespace

InnoDB 使用两种类型的临时表空间。会话临时表空间 用于存储用户创建的临时表和优化器创建的内部临时表。全局临时表空间 用于存储用户创建临时表所做更改的回滚段。 InnoDB uses two types of temporary tablespace. Session temporary tablespaces store user-created temporary tables and internal temporary tables created by the optimizer. The global temporary tablespace stores rollback segments for changes made to user-created temporary tables.

另请参见 全局临时表空间,会话临时表空间,临时表。See Also global temporary tablespace, session temporary tablespace, temporary table.

文本集合text collection

包含在 全文索引 中的一组列。 The set of columns included in a FULLTEXT index.

另请参见 FULLTEXT 索引。See Also FULLTEXT index.

TGS

一个 Kerberos 票证授予服务器。TGS 也可以指票证授予服务器提供的票证授予服务。 A Kerberos ticket-granting server. TGS can also refer to the ticket-granting service provided by a ticket-granting server.

另见 票证授予服务器。See Also ticket-granting server.

TGT

参见 票证授予票。See ticket-granting ticket.

线程thread

一种处理单元,通常比进程更轻量级,从而允许更高的并发。 A unit of processing that is typically more lightweight than a process, allowing for greater concurrency.

另请参见 并发,主线程,进程,Pthreads。See Also concurrency, master thread, process, Pthreads.

票据授予服务器ticket-granting server

在 Kerberos 中,一种提供票据的服务器。票据授予服务器(TGS)与认证服务器(AS)一起组成密钥分发中心(KDC)。 In Kerberos, a server that provides tickets. The ticket-granting server (TGS) combined with an authentication server (AS) make up a key distribution center (KDC).

TGS 也可以指由票据授予服务器提供的票据授予服务。TGS can also refer to the ticket-granting service provided by the ticket-granting server.

另见 认证服务器,密钥分发中心。See Also authentication server, key distribution center.

票据授予票据ticket-granting ticket

在 Kerberos 中,票据授予票据会提交给票据授予服务器 (TGS) 以获取服务访问的服务票据。 In Kerberos, a ticket-granting ticket is presented to the ticket-granting server (TGS) to obtain service tickets for service access.

另见 票证授予服务器。See Also ticket-granting server.

Tomcat

一个开源的 J2EE 应用服务器,实现了 Java Servlet 和 JavaServer Pages 编程技术。由一个 Web 服务器和 Java Servlet 容器组成。与 MySQL 一起使用时,通常配合 Connector/J 使用。 An open source J2EE application server, implementing the Java Servlet and JavaServer Pages programming technologies. Consists of a web server and Java servlet container. With MySQL, typically used in conjunction with Connector/J.

参见 J2EE。See Also J2EE.

撕页torn page

一种可能由于 I/O 设备配置和硬件故障组合而发生的错误情况。如果数据以小于 InnoDB 页面大小(默认 16KB)的块写出,写入过程中发生硬件故障可能导致只有部分页面被存储到磁盘。InnoDB 双写缓冲区可以防止这种可能性。 An error condition that can occur due to a combination of I/O device configuration and hardware failure. If data is written out in chunks smaller than the InnoDB page size (by default, 16KB), a hardware failure while writing could result in only part of a page being stored to disk. The InnoDB doublewrite buffer guards against this possibility.

参见 双写缓冲区。See Also doublewrite buffer.

TPS

“每秒事务数”(transactions per second)”的缩写,一种有时在基准测试中使用的计量单位。其数值取决于特定基准测试所代表的工作负载,以及您可以控制的因素,如硬件容量和数据库配置。 Acronym for “transactions per second”, a unit of measurement sometimes used in benchmarks. Its value depends on the workload represented by a particular benchmark test, combined with factors that you control such as the hardware capacity and database configuration.

另见 事务,工作负载。See Also transaction, workload.

事务transaction

事务是原子工作单位,可以提交或回滚。当一个事务对数据库进行多次更改时,无论是提交事务时所有更改都成功,还是回滚事务时所有更改都被撤销。 Transactions are atomic units of work that can be committed or rolled back. When a transaction makes multiple changes to the database, either all the changes succeed when the transaction is committed, or all the changes are undone when the transaction is rolled back.

由InnoDB实现的数据库事务具有一组属性,这些属性统称为缩写ACID,即原子性、一致性、隔离性和持久性。Database transactions, as implemented by InnoDB, have properties that are collectively known by the acronym ACID, for atomicity, consistency, isolation, and durability.

另请参见 ACID、提交、隔离级别、锁、回滚。See Also ACID, commit, isolation level, lock, rollback.

事务 IDtransaction ID

与每行(row)相关的内部字段。该字段会被 INSERT、UPDATE 和 DELETE 操作物理更改,用于记录哪个 事务 锁定了该行。 An internal field associated with each row. This field is physically changed by INSERT, UPDATE, and DELETE operations to record which transaction has locked the row.

另请参见 隐式行锁、行、事务。See Also implicit row lock, row, transaction.

透明页压缩transparent page compression

MySQL 5.7.8 中新增的一个功能,允许对位于 每表文件 表空间中的 InnoDB 表进行页级压缩。页压缩可以通过在 CREATE TABLE 或 ALTER TABLE 中指定 COMPRESSION 属性来启用。更多信息,请参见 第 17.9.2 节,“InnoDB 页压缩”。 A feature added in MySQL 5.7.8 that permits page-level compression for InnoDB tables that reside in file-per-table tablespaces. Page compression is enabled by specifying the COMPRESSION attribute with CREATE TABLE or ALTER TABLE. For more information, see Section 17.9.2, “InnoDB Page Compression”.

另请参见 每表文件、打孔、稀疏文件。See Also file-per-table, hole punching, sparse file.

可移植表空间transportable tablespace

一个功能允许将 表空间 从一个实例移动到另一个实例。传统上,这对于 InnoDB 表空间是不可能的,因为所有表数据都是 系统表空间 的一部分。在 MySQL 5.6 及更高版本中,FLUSH TABLES ... FOR EXPORT 语法可以准备 InnoDB 表以便复制到另一台服务器;在另一台服务器上运行 ALTER TABLE ... DISCARD TABLESPACE 和 ALTER TABLE ... IMPORT TABLESPACE 会将复制的数据文件导入到另一个实例中。一个单独的 .cfg 文件 与 .ibd 文件 一起复制,用于在导入表空间时更新表元数据(例如 空间 ID)。有关使用信息,请参见 第 17.6.1.3 节,“导入 InnoDB 表”。 A feature that allows a tablespace to be moved from one instance to another. Traditionally, this has not been possible for InnoDB tablespaces because all table data was part of the system tablespace. In MySQL 5.6 and higher, the FLUSH TABLES ... FOR EXPORT syntax prepares an InnoDB table for copying to another server; running ALTER TABLE ... DISCARD TABLESPACE and ALTER TABLE ... IMPORT TABLESPACE on the other server brings the copied data file into the other instance. A separate .cfg file, copied along with the .ibd file, is used to update the table metadata (for example the space ID) as the tablespace is imported. See Section 17.6.1.3, “Importing InnoDB Tables” for usage information.

另请参见 .cfg 文件、.ibd 文件、空间 ID、系统表空间、表空间。See Also .cfg file, .ibd file, space ID, system tablespace, tablespace.

故障排除troubleshooting

确定问题来源的过程。一些用于排除 MySQL 问题的资源包括: The process of determining the source of a problem. Some of the resources for troubleshooting MySQL problems include:

截断truncate

一种 DDL 操作,用于清空表的全部内容,同时保留表和相关索引。与 drop 相对。虽然在概念上其结果与没有 WHERE 子句的 DELETE 语句相同,但其幕后操作方式不同:InnoDB 会创建一个新的空表,删除旧表,然后将新表重命名以代替旧表。因为这是一个 DDL 操作,所以无法 回滚。 A DDL operation that removes the entire contents of a table, while leaving the table and related indexes intact. Contrast with drop. Although conceptually it has the same result as a DELETE statement with no WHERE clause, it operates differently behind the scenes: InnoDB creates a new empty table, drops the old table, then renames the new table to take the place of the old one. Because this is a DDL operation, it cannot be rolled back.

如果被截断的表包含引用另一个表的外键,截断操作会使用较慢的操作方法,一次删除一行,以便根据任何ON DELETE CASCADE子句需要删除引用表中的对应行。(MySQL 5.5 及更高版本不允许这种较慢的截断形式,如果涉及外键则会返回错误。在这种情况下,请使用DELETE语句。)If the table being truncated contains foreign keys that reference another table, the truncation operation uses a slower method of operation, deleting one row at a time so that corresponding rows in the referenced table can be deleted as needed by any ON DELETE CASCADE clause. (MySQL 5.5 and higher do not allow this slower form of truncate, and return an error instead if foreign keys are involved. In this case, use a DELETE statement instead.

另请参见 DDL、drop、外键、回滚。See Also DDL, drop, foreign key, rollback.

信任库truststore

另请参见 SSL。See Also SSL.

元组tuple

一个技术术语,表示有序的元素集合。它是一个抽象概念,用于数据库理论的正式讨论中。在数据库领域,元组通常由表行的列表示。它们也可以由查询的结果集表示,例如,仅检索表的某些列或连接表的列的查询结果。 A technical term designating an ordered set of elements. It is an abstract notion, used in formal discussions of database theory. In the database field, tuples are usually represented by the columns of a table row. They could also be represented by the result sets of queries, for example, queries that retrieved only some columns of a table, or columns from joined tables.

另请参见 游标。See Also cursor.

两阶段提交two-phase commit

一种操作,它是分布式 事务 的一部分,根据 XA 规范执行。(有时缩写为 2PC。)当多个数据库参与事务时,要么所有数据库 提交 更改,要么所有数据库 回滚 更改。 An operation that is part of a distributed transaction, under the XA specification. (Sometimes abbreviated as 2PC.) When multiple databases participate in the transaction, either all databases commit the changes, or all databases roll back the changes.

另请参见 提交、回滚、事务、XA。See Also commit, rollback, transaction, XA.

UU

撤销undo

在一个事务的整个生命周期内维护的数据,记录所有更改,以便在发生回滚操作时可以撤销。这些数据存储在回滚日志中,位置要么在系统表空间(在 MySQL 5.7 或更早版本中),要么在独立的回滚表空间中。从 MySQL 8.0 开始,回滚日志默认存储在回滚表空间中。 Data that is maintained throughout the life of a transaction, recording all changes so that they can be undone in case of a rollback operation. It is stored in undo logs either within the system tablespace (in MySQL 5.7 or earlier) or in separate undo tablespaces. As of MySQL 8.0, undo logs reside in undo tablespaces by default.

另请参见 回滚、回滚段、系统表空间、事务、撤销日志、撤销表空间。See Also rollback, rollback segment, system tablespace, transaction, undo log, undo tablespace.

撤销缓冲区undo buffer

参见 撤销日志。See undo log.

撤销日志undo log

一个存储区域,用于保存由活动事务修改的数据副本。如果另一个事务需要查看原始数据(作为一致性读取操作的一部分),未修改的数据将从该存储区域中检索。 A storage area that holds copies of data modified by active transactions. If another transaction needs to see the original data (as part of a consistent read operation), the unmodified data is retrieved from this storage area.

在 MySQL 5.6 和 MySQL 5.7 中,你可以使用 innodb_undo_tablespaces 变量将回滚日志存放在 回滚表空间 中,这些表空间可以放置在其他存储设备上,例如 SSD。在 MySQL 8.0 中,回滚日志存放在 MySQL 初始化时创建的两个默认回滚表空间中,并且可以使用 CREATE UNDO TABLESPACE 语法创建额外的回滚表空间。In MySQL 5.6 and MySQL 5.7, you can use the innodb_undo_tablespaces variable have undo logs reside in undo tablespaces, which can be placed on another storage device such as an SSD. In MySQL 8.0, undo logs reside in two default undo tablespaces that are created when MySQL is initialized, and additional undo tablespaces can be created using CREATE UNDO TABLESPACE syntax.

回滚日志被拆分为不同的部分,包括 插入回滚缓冲 和 更新回滚缓冲。The undo log is split into separate portions, the insert undo buffer and the update undo buffer.

另请参见 一致性读,回滚段,固态硬盘 (SSD),系统表空间,事务,回滚表空间。See Also consistent read, rollback segment, SSD, system tablespace, transaction, undo tablespace.

回滚日志段undo log segment

一组回滚日志。回滚日志段存在于回滚段中。一个回滚日志段可能包含来自多个事务的回滚日志。一个回滚日志段在同一时间只能被一个事务使用,但在事务提交或回滚释放后可以再次使用。也可以称为“回滚段”。 A collection of undo logs. Undo log segments exists within rollback segments. An undo log segment might contain undo logs from multiple transactions. An undo log segment can only be used by one transaction at a time but can be reused after it is released at transaction commit or rollback. May also be referred to as an “undo segment”.

另请参见 提交,回滚,回滚段,回滚日志。See Also commit, rollback, rollback segment, undo log.

回滚表空间undo tablespace

撤消表空间包含 撤消日志。撤消日志存在于 撤消日志段 中,这些日志段包含在 回滚段 中。回滚段传统上驻留在系统表空间中。从 MySQL 5.6 开始,回滚段可以驻留在撤消表空间中。在 MySQL 5.6 和 MySQL 5.7 中,撤消表空间的数量由 innodb_undo_tablespaces 配置选项控制。在 MySQL 8.0 中,当初始化 MySQL 实例时,会创建两个默认撤消表空间,并且可以使用 CREATE UNDO TABLESPACE 语法创建其他撤消表空间。 An undo tablespace contains undo logs. Undo logs exist within undo log segments, which are contained within rollback segments. Rollback segments have traditionally resided in the system tablespace. As of MySQL 5.6, rollback segments can reside in undo tablespaces. In MySQL 5.6 and MySQL 5.7, the number of undo tablespaces is controlled by the innodb_undo_tablespaces configuration option. In MySQL 8.0, two default undo tablespaces are created when the MySQL instance is initialized, and additional undo tablespaces can be created using CREATE UNDO TABLESPACE syntax.

欲了解更多信息,请参见 第 17.6.3.4 节,“Undo 表空间”。For more information, see Section 17.6.3.4, “Undo Tablespaces”.

另请参见 回滚段、系统表空间、撤销日志、撤销日志段。See Also rollback segment, system tablespace, undo log, undo log segment.

Unicode

一种以灵活和标准化方式支持民族字符、字符集、代码页及其他国际化方面的系统。 A system for supporting national characters, character sets, code pages, and other internationalization aspects in a flexible and standardized way.

Unicode 支持是 ODBC 标准的一个重要方面。Connector/ODBC 5.1 是一个 Unicode 驱动程序,而 Connector/ODBC 3.51 是一个 ANSI 驱动程序。Unicode support is an important aspect of the ODBC standard. Connector/ODBC 5.1 is a Unicode driver, as opposed to Connector/ODBC 3.51, which is an ANSI driver.

另请参阅 ANSI, Connector/ODBC, ODBC。See Also ANSI, Connector/ODBC, ODBC.

唯一约束unique constraint

一种 约束,用于确保列中不包含任何重复值。在 关系代数中,它用于指定一对一关系。为了提高检查某个值是否可以插入(即该值尚不存在于列中)的效率,唯一约束由底层的 唯一索引 支持。 A kind of constraint that asserts that a column cannot contain any duplicate values. In terms of relational algebra, it is used to specify 1-to-1 relationships. For efficiency in checking whether a value can be inserted (that is, the value does not already exist in the column), a unique constraint is supported by an underlying unique index.

另见 约束,关系,唯一索引。See Also constraint, relational, unique index.

唯一索引unique index

对具有唯一约束的列或列集合的索引。因为已知该索引不包含任何重复值,所以某些类型的查找和计数操作比普通索引更高效。针对这种类型索引的大多数查找只是为了确定某个值是否存在。索引中的值数量与表中的行数相同,或者至少与有关列中非空值的行数相同。 An index on a column or set of columns that have a unique constraint. Because the index is known not to contain any duplicate values, certain kinds of lookups and count operations are more efficient than in the normal kind of index. Most of the lookups against this type of index are simply to determine if a certain value exists or not. The number of values in the index is the same as the number of rows in the table, or at least the number of rows with non-null values for the associated columns.

更改缓冲优化不适用于唯一索引。作为一种解决方法,在将大量数据加载到InnoDB表时,可以暂时设置unique_checks=0。Change buffering optimization does not apply to unique indexes. As a workaround, you can temporarily set unique_checks=0 while doing a bulk data load into an InnoDB table.

另请参见 基数、更改缓冲、唯一约束、唯一键。See Also cardinality, change buffering, unique constraint, unique key.

唯一键unique key

组成唯一索引的一组列(一个或多个)。当你可以定义一个 WHERE 条件,正好匹配一行,并且查询可以使用相关的唯一索引时,查找和错误处理可以非常高效地执行。 The set of columns (one or more) comprising a unique index. When you can define a WHERE condition that matches exactly one row, and the query can use an associated unique index, the lookup and error handling can be performed very efficiently.

另见 基数、唯一约束、唯一索引。See Also cardinality, unique constraint, unique index.

UPN

参见 用户主体名称。See user principal name.

用户主体名称user principal name

Kerberos 命名实体表示用户的名称。 The name for a Kerberos named entity that represents a user.

另请参见 主体。See Also principal.

VV

可变长度类型variable-length type

一种可变长度的数据类型。VARCHAR、VARBINARY 以及 BLOB 和 TEXT 类型都是可变长度类型。 A data type of variable length. VARCHAR, VARBINARY, and BLOB and TEXT types are variable-length types.

InnoDB 将长度大于或等于 768 字节的定长字段视为变长字段,可以存储在 页外。例如,如果字符集的最大字节长度大于 3(如 utf8mb4),则 CHAR(255) 列的长度可能超过 768 字节。InnoDB treats fixed-length fields greater than or equal to 768 bytes in length as variable-length fields, which can be stored off-page. For example, a CHAR(255) column can exceed 768 bytes if the maximum byte length of the character set is greater than 3, as it is with utf8mb4.

另见 页外列,溢出页。See Also off-page column, overflow page.

受害者victim

当检测到 死锁 时,会自动选择被 回滚 的 事务。InnoDB 会回滚更新行数最少的事务。 The transaction that is automatically chosen to be rolled back when a deadlock is detected. InnoDB rolls back the transaction that has updated the fewest rows.

死锁检测 可以使用 innodb_deadlock_detect 配置选项来禁用。Deadlock detection can be disabled using the innodb_deadlock_detect configuration option.

另请参见 死锁,死锁检测,innodb_lock_wait_timeout,事务。See Also deadlock, deadlock detection, innodb_lock_wait_timeout, transaction.

视图view

一个存储的查询,调用时会生成结果集。视图充当虚拟表。 A stored query that when invoked produces a result set. A view acts as a virtual table.

虚拟列virtual column

参见 虚拟生成列。See virtual generated column.

虚拟生成列virtual generated column

一列的值是根据列定义中包含的表达式计算得出的。列值不存储,而是在读取行时立即在任何 BEFORE 触发器之后进行评估。虚拟生成列不占用存储空间。InnoDB 支持对虚拟生成列的二级索引。 A column whose values are computed from an expression included in the column definition. Column values are not stored, but are evaluated when rows are read, immediately after any BEFORE triggers. A virtual generated column takes no storage. InnoDB supports secondary indexes on virtual generated columns.

与 存储生成列 对比。Contrast with stored generated column.

另请参阅 基础列、生成列、存储生成列。See Also base column, generated column, stored generated column.

虚拟索引virtual index

虚拟索引是一个或多个 虚拟生成列 上的 辅助索引,或者是虚拟生成列与普通列或存储生成列的组合上的索引。有关更多信息,请参见 第 15.1.20.9 节,“辅助索引和生成列”。 A virtual index is a secondary index on one or more virtual generated columns or on a combination of virtual generated columns and regular columns or stored generated columns. For more information, see Section 15.1.20.9, “Secondary Indexes and Generated Columns”.

另请参阅 辅助索引、存储生成列、虚拟生成列。See Also secondary index, stored generated column, virtual generated column.

Visual Studio

有关支持的 Visual Studio 版本,请参见以下参考资料: For supported versions of Visual Studio, see the following references:

另请参阅 Connector/C, Connector/NET。See Also Connector/C++, Connector/NET.

WW

wait

当一个操作,例如获取 锁、互斥锁 或 闩锁,无法立即完成时,InnoDB 会暂停并再次尝试。暂停的机制足够复杂,因此这个操作有其自己的名称,即 等待。单个线程通过结合内部 InnoDB 调度、操作系统 wait() 调用和短时 自旋 循环来暂停。 When an operation, such as acquiring a lock, mutex, or latch, cannot be completed immediately, InnoDB pauses and tries again. The mechanism for pausing is elaborate enough that this operation has its own name, the wait. Individual threads are paused using a combination of internal InnoDB scheduling, operating system wait() calls, and short-duration spin loops.

在负载较重并且事务较多的系统上,你可以使用 SHOW INNODB STATUS 命令或 Performance Schema 的输出,来判断线程是否花费过多时间在等待上,如果是这样,可以了解如何提高 并发性。On systems with heavy load and many transactions, you might use the output from the SHOW INNODB STATUS command or Performance Schema to determine whether threads are spending too much time waiting, and if so, how you can improve concurrency.

另请参见 并发性、闩锁、锁、互斥锁、Performance Schema、自旋。See Also concurrency, latch, lock, mutex, Performance Schema, spin.

热备份warm backup

在数据库运行时进行的备份,但在备份过程中会限制某些数据库操作。例如,表可能变为只读。对于繁忙的应用程序和网站,你可能更喜欢热备份。 A backup taken while the database is running, but that restricts some database operations during the backup process. For example, tables might become read-only. For busy applications and websites, you might prefer a hot backup.

另见 备份、冷备份、热备份。See Also backup, cold backup, hot backup.

热身warm up

在启动后运行系统一段时间的典型工作负载,以便缓冲池和其他内存区域像在正常情况下那样被填充。当 MySQL 服务器重启或面临新的工作负载时,这一过程会自然发生。 To run a system under a typical workload for some time after startup, so that the buffer pool and other memory regions are filled as they would be under normal conditions. This process happens naturally over time when a MySQL server is restarted or subjected to a new workload.

通常,在进行性能测试之前,你需要运行一段时间的工作负载来预热缓冲池,以确保多次运行结果一致;否则,第一次运行时性能可能会被人为地降低。Typically, you run a workload for some time to warm up the buffer pool before running performance tests, to ensure consistent results across multiple runs; otherwise, performance might be artificially low during the first run.

在 MySQL 5.6 中,您可以通过启用 innodb_buffer_pool_dump_at_shutdown 和 innodb_buffer_pool_load_at_startup 配置选项,加快预热过程,在重启后将缓冲池内容重新加载到内存中。这些选项在 MySQL 5.7 中默认启用。参见 第 17.8.3.6 节,“保存和恢复缓冲池状态”。In MySQL 5.6, you can speed up the warmup process by enabling the innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_at_startup configuration options, to bring the contents of the buffer pool back into memory after a restart. These options are enabled by default in MySQL 5.7. See Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”.

另请参见 缓冲池,工作负载。See Also buffer pool, workload.

工作负载workload

数据库应用在典型或高峰使用期间执行的 SQL 和其他数据库操作的组合和数量。您可以在性能测试期间对数据库施加特定的工作负载,以识别 瓶颈,或者在容量规划期间进行测试。 The combination and volume of SQL and other database operations, performed by a database application during typical or peak usage. You can subject the database to a particular workload during performance testing to identify bottlenecks, or during capacity planning.

另请参见 瓶颈、CPU 受限、磁盘受限、SQL。See Also bottleneck, CPU-bound, disk-bound, SQL.

写合并write combining

一种优化技术,当 脏页 从 InnoDB 缓冲池 刷新 时减少写操作。如果一个页面中的某行被多次更新,或者同一页面上的多行被更新,所有这些更改将通过一次写操作存储到数据文件中,而不是为每次更改各写一次。 An optimization technique that reduces write operations when dirty pages are flushed from the InnoDB buffer pool. If a row in a page is updated multiple times, or multiple rows on the same page are updated, all of those changes are stored to the data files in a single write operation rather than one write for each change.

另请参见 缓冲池、脏页、刷写。See Also buffer pool, dirty page, flush.

XX

XA

一个用于协调分布式 事务 的标准接口,允许多个数据库参与同一事务,同时保持 ACID 合规。有关完整细节,请参见 第 15.3.8 节,“XA 事务”。 A standard interface for coordinating distributed transactions, allowing multiple databases to participate in a transaction while maintaining ACID compliance. For full details, see Section 15.3.8, “XA Transactions”.

默认情况下启用 XA 分布式事务支持。XA Distributed Transaction support is enabled by default.

另请参见 ACID、二进制日志、提交、事务、两阶段提交。See Also ACID, binary log, commit, transaction, two-phase commit.

YY

young

页 在 InnoDB 缓冲池 中的一个特征,意味着它最近已被访问,因此会在缓冲池数据结构内移动,以便不会被 LRU 算法过早 刷新。这个术语被用于一些与缓冲池相关的表的 INFORMATION_SCHEMA 列名中。 A characteristic of a page in the InnoDB buffer pool meaning that it has been accessed recently, and so is moved within the buffer pool data structure, so that it is not flushed too soon by the LRU algorithm. This term is used in some INFORMATION_SCHEMA column names of tables related to the buffer pool.

另请参见 缓冲池、刷新、INFORMATION_SCHEMA、LRU、页。See Also buffer pool, flush, INFORMATION_SCHEMA, LRU, page.