# 关系型数据库管理系统比较

关系型数据库管理系统（RDBMS）的比较，是将 [Oracle Database](https://www.edgepedia.org/zh/oracle-database)、MySQL、Microsoft SQL Server、[PostgreSQL](https://www.edgepedia.org/zh/postgresql)、IBM Db2 和 SQLite 等产品在许可方式、SQL 一致性、并发控制、性能和典型工作负载等方面相互对照。它们都实现了[埃德加·F·科德](https://www.edgepedia.org/zh/edgar-f-codd)（Edgar F. Codd）于 1970 年提出的关系模型——数据存储在关系中，并通过独立于机器表示的高级语言访问——但在许可条款、架构和预期规模上差异显著。<sup>[1](https://db.dobo.sk/wp-content/uploads/2015/11/Codd_1970_A_relational_model.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 共同基础 | 所有主流 RDBMS 都实现了科德 1970 年的关系模型和 SQL，SQL 由 ISO/IEC 9075 标准化，最近一次更新在 2023 年<sup>[1](https://db.dobo.sk/wp-content/uploads/2015/11/Codd_1970_A_relational_model.pdf)</sup><sup> • </sup><sup>[2](https://technav.ieee.org/area/databases/)</sup> |
| 许可分野 | PostgreSQL 使用宽松的 PostgreSQL 许可证；MySQL 采用 GPLv2 或商业许可的双重许可；SQL Server 和 Oracle Database 为商业产品，各有一个免费入门版本<sup>[3](https://www.postgresql.org/about/licence/)</sup><sup> • </sup><sup>[4](https://dev.mysql.com/doc/refman/26.7/en/introduction.html)</sup><sup> • </sup><sup>[5](https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2025?view=fabric-sqldb)</sup> |
| 流行度（DB-Engines，2026 年 10 月） | Oracle 1119.79，MySQL 837.96，SQL Server 694.47，PostgreSQL 688.75，Snowflake 221.30，IBM Db2 106.29，SQLite 95.73，MariaDB 75.60<sup>[6](https://db-engines.com/en/ranking/relational%2Bdbms/all)</sup> |
| 开发者使用率（Stack Overflow 2025） | PostgreSQL 65.5%（32 种环境中排名第一），MySQL 40.50%，SQL Server 30.10%<sup>[7](https://pg.center/ecosystem/stackoverflow/)</sup> |
| 当前版本 | PostgreSQL 18（2025 年 9 月，19 处于测试阶段），SQL Server 2025（17.x），Oracle AI Database 26ai（2025 年 10 月），MySQL 9.x<sup>[8](https://www.postgresql.org/about/)</sup><sup> • </sup><sup>[9](https://learn.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2025?preserve-view=true&view=sql-server-ver17)</sup><sup> • </sup><sup>[10](https://www.oracle.com/database/ai-native-database-26ai/)</sup> |
| 标准基准测试 | 现行 TPC 基准包括 TPC-C 5.11.0（OLTP）、TPC-E 1.14.0、TPC-H 3.0.1 和 TPC-DS 4.0.0（分析型）<sup>[11](https://www.tpc.org/tpc_documents_current_versions/current_specifications5.asp?mode=TPC-MEMBER)</sup> |

## 起源

关系模型可追溯至 E. F. 科德的论文《大型共享数据库的数据关系模型》，发表于 1970 年 6 月的《ACM 通讯》第 13 卷第 6 期，第 377 至 387 页。当时在圣何塞 IBM 研究实验室任职的科德主张，用户和应用程序应当与数据的物理组织方式隔离开来，并指出排序、索引和访问路径依赖是现有系统中仍需消除的依赖。<sup>[1](https://db.dobo.sk/wp-content/uploads/2015/11/Codd_1970_A_relational_model.pdf)</sup> IBM 的 System R 项目于 1975 年至 1979 年在同一实验室运行，证明了该模型能够提供生产使用所需的功能和性能；IBM 研究员[帕特里夏·塞林格](https://www.edgepedia.org/zh/patricia-selinger)（Patricia Selinger）拥有哈佛大学应用数学与计算机科学博士学位，她发明了基于成本的查询优化器，通过估算处理时间和资源消耗来选择数据检索方式。System R 催生了 SQL 的发明，并成为 IBM 关系型产品的前身：SQL/DS 于 1981 年发布，大型机版 DB2 于 1983 年推出。<sup>[12](https://www.ibm.com/history/patricia-selinger)</sup><sup> • </sup><sup>[13](https://research.ibm.com/publications/a-history-and-evaluation-of-system-r)</sup>

商业竞争很快开始。Oracle 第 2 版于 1979 年发布，Oracle 称其为第一个商业 SQL 关系型数据库管理系统；该公司由[拉里·埃里森](https://www.edgepedia.org/zh/larry-ellison)（Larry Ellison）、鲍勃·迈纳（Bob Miner）和埃德·奥茨（Ed Oates）于 1977 年创立，起因是埃里森读到了 IBM 原型的相关资料。<sup>[14](https://www.oracle.com/us/corporate/profit/p27anniv-timeline-151918.pdf)</sup><sup> • </sup><sup>[15](https://www.oracle.com/database/50-years-relational-database/)</sup> 在学术方面，加州大学伯克利分校的 POSTGRES 项目在[迈克尔·斯通布雷克](https://www.edgepedia.org/zh/michael-stonebraker)（Michael Stonebraker）的主持下于 1986 年开始实现；1994 年，安德鲁·余（Andrew Yu）和陈乔利（Jolly Chen）添加了 SQL 解释器，产出 Postgres95；1996 年项目更名为 PostgreSQL，版本号从 6.0 重新开始。<sup>[16](https://www.postgresql.org/docs/9.1/history.html)</sup>

## 许可与版本

**许可是实践中最显著的差异之一。** PostgreSQL 在 PostgreSQL 许可证下发布，这是一种类似 BSD 或 MIT 的宽松许可证，且没有更改计划；该项目指出，这使得它受到那些希望嵌入数据库而不必担心费用或锁定的供应商的欢迎。<sup>[3](https://www.postgresql.org/about/licence/)</sup> MySQL 采用双重许可：用户可以在 GNU 通用公共许可证下将其作为开源产品使用，也可以从 Oracle 购买商业许可证；将 MySQL 与专有软件结合而不发布源代码的发行商必须取得商业许可证。<sup>[4](https://dev.mysql.com/doc/refman/26.7/en/introduction.html)</sup><sup> • </sup><sup>[17](https://www.mysql.com/about/legal/licensing/oem/)</sup> Oracle 销售商业版本，并提供单独许可的选项，如多租户和高级压缩，同时提供 Oracle AI Database 26ai 免费版和始终免费的自治数据库层级。<sup>[18](https://docs.oracle.com/en/database/oracle/oracle-database/26/dblic/database-licensing-information-user-manual.pdf)</sup><sup> • </sup><sup>[10](https://www.oracle.com/database/ai-native-database-26ai/)</sup>

SQL Server 为商业产品，提供免费的开发者版和 Express 版。在 SQL Server 2025（17.x）中，Express 版限制为 50 GB 关系数据库，标准版限制为 4 个插槽或 32 核中较小者，缓冲池 256 GB，Web 版已停止提供。<sup>[9](https://learn.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2025?preserve-view=true&view=sql-server-ver17)</sup> 面向买家的比较指南总结了同样的分野：开源 PostgreSQL 和 MySQL 消除了许可成本，但需要在支持合同和内部专业知识上投入，而商业系统则按核心或订阅收取许可费。<sup>[19](https://forgesql.com/blog/how-to-choose-the-right-database)</sup>

## 架构与并发

**并发控制在机制上有所不同。** PostgreSQL 使用多版本并发控制（MVCC），每个事务读取数据的快照，修改过的元组被版本化，旧版本在能看到它们的事务结束后被清除。<sup>[20](https://www.postgresql.org/docs/current/glossary.html)</sup> 其隔离级别映射由此设计决定：PostgreSQL 接受全部四种标准隔离级别，但内部只实现三种不同的级别，读未提交的行为等同于读已提交——即默认级别，在该级别下查询看到的是其开始瞬间的数据库快照。<sup>[21](https://www.postgresql.org/docs/16/transaction-iso.html)</sup> MySQL 的 InnoDB 存储引擎使用双写缓冲区，默认启用（`innodb_doublewrite=ON`），在写入数据文件之前先将页面写入暂存区，以便崩溃造成的残缺页可以恢复。<sup>[22](https://dev.mysql.com/doc/refman/9.5/en/innodb-disk-io.html)</sup> SQL Server 依赖锁和多粒度锁层次结构以及行版本控制；当一条语句在表的单个引用上获取至少 5,000 个锁时，会发生锁升级。<sup>[23](https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide?view=sql-server-2017)</sup> MySQL 中隔离级别可通过 `SET TRANSACTION` 和 `transaction_isolation` 系统变量配置，取值包括 `REPEATABLE READ` 和 `SERIALIZABLE`。<sup>[24](https://dev.mysql.com/doc/refman/26.7/en/set-transaction.html)</sup>

**横向扩展架构是各厂商的差异化特征。** 自 Oracle Database 21c 起，多租户容器数据库（CDB）是 Oracle 唯一支持的架构：一个容器数据库承载多个可插拔数据库（PDB），这些 PDB 对应用程序表现为独立的数据库；将 100 个 PDB 整合到一台主机上可共享单个实例，减少补丁、升级和内存管理开销。<sup>[25](https://docs.oracle.com/en/database/oracle/oracle-database/26/multi/introduction-to-the-multitenant-architecture.html)</sup>

## 性能测量

[事务处理性能委员会](https://www.edgepedia.org/zh/transaction-processing-performance-council)（TPC）是一家开发以数据为中心的基准标准的非营利公司，它发布的基准最常用于在相同规则下比较 RDBMS。<sup>[26](https://tpc.org/)</sup> 截至 2026 年底，其现行规范包括 TPC-C 5.11.0——一种在线事务处理基准，其 tpm-C 指标计算的是每分钟完成的完整业务操作数，而非单个底层事务；TPC-E 1.14.0；以及分析型的 [TPC-H](https://www.edgepedia.org/zh/tpc-h) 3.0.1 和 TPC-DS 4.0.0。<sup>[11](https://www.tpc.org/tpc_documents_current_versions/current_specifications5.asp?mode=TPC-MEMBER)</sup><sup> • </sup><sup>[27](https://tpc.org/tpcc/detail5.asp)</sup> TPC-DS 根据其生成器产生的数据量定义离散的比例因子，目前有效测试数据库的最大值设为 100 TB。<sup>[28](https://tpc.org/tpc_documents_current_versions/pdf/tpc-ds_v2.13.0.pdf)</sup>

学术综述告诫不要对任何单一比较过度解读。根据一篇关于 DBMS 性能基准文献的系统综述，评估很少反映真实世界的使用模式，已发表的测试通常缺乏复现或得出确定结论所需的细节。<sup>[29](https://arxiv.org/abs/2301.01095)</sup> 已发表的直接对比研究确实存在，例如 2020 年围绕共同模式和共同测试场景对 Oracle 19c、SQL Server 2019、PostgreSQL 12 和 MySQL 8 进行的比较，以及 2025 年跨六种工作负载类型对 PostgreSQL 16 和 SQL Server 2022 进行的基准测试，但其结果仅适用于所测试的版本和配置。<sup>[30](https://ph.pollub.pl/index.php/jcsi/article/download/2281/2153/8533)</sup><sup> • </sup><sup>[31](https://pg-versus-ms.com/postgresql-vs-sql-server-benchmark-six-workloads/)</sup>

## 流行度与当前方向

DB-Engines 排名每月更新，通过综合搜索引擎提及、[Google Trends](https://www.edgepedia.org/zh/google-trends) 关注度、Stack Overflow 讨论、招聘信息、LinkedIn 个人资料和社交网络提及来衡量流行度；它不统计安装量，其分值是仅用于比较的相对值。<sup>[6](https://db-engines.com/en/ranking/relational%2Bdbms/all)</sup><sup> • </sup><sup>[32](https://db-engines.com/en/ranking_definition)</sup> 2026 年 10 月，它将 Oracle 排在关系型系统首位，为 1119.79，其次是 MySQL 837.96、SQL Server 694.47 和 PostgreSQL 688.75，PostgreSQL 是前四名中唯一较上一年增长的（+5.50）。<sup>[6](https://db-engines.com/en/ranking/relational%2Bdbms/all)</sup> 在开发者中，Stack Overflow 2025 年调查记录 PostgreSQL 为使用最多的数据库环境，占 65.5%，领先于 MySQL 的 40.50% 和 SQL Server 的 30.10%，且自 2023 年以来 PostgreSQL 一直是最想使用和最受推崇的数据库。<sup>[7](https://pg.center/ecosystem/stackoverflow/)</sup><sup> • </sup><sup>[33](https://survey.stackoverflow.co/2025/technology)</sup>

**近期版本都聚焦于 AI 功能。** Oracle AI Database 26ai 于 2025 年 10 月作为长期支持版本发布，取代 23ai，新增原生 AI 向量搜索、基于 [Apache Iceberg](https://www.edgepedia.org/zh/apache-iceberg) 数据的自治 AI 湖仓以及自然语言查询生成。<sup>[10](https://www.oracle.com/database/ai-native-database-26ai/)</sup> SQL Server 2025（17.x）引入向量数据类型，以优化的二进制格式存储向量并以 JSON 数组形式暴露，同时在 SQL Server Management Studio 中集成 [GitHub Copilot](https://www.edgepedia.org/zh/github-copilot)。<sup>[9](https://learn.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2025?preserve-view=true&view=sql-server-ver17)</sup> PostgreSQL 18 于 2025 年 9 月发布，符合 SQL:2023 核心一致性 177 项强制特性中的至少 170 项；处于测试阶段的 PostgreSQL 19 新增 `REPACK` 命令，结合了 `VACUUM FULL` 和 `CLUSTER` 的功能，并带有非阻塞的 `CONCURRENTLY` 选项。<sup>[8](https://www.postgresql.org/about/)</sup><sup> • </sup><sup>[34](https://www.postgresql.org/docs/19/release-19.html?trk=article-ssr-frontend-pulse_little-text-block)</sup>

## 在系统之间选择

涵盖 PostgreSQL、MySQL、SQL Server、Oracle 和 SQLite 的特性矩阵列出了主流系统对表级锁、分区和原生 JSON 的支持情况，差异在于细节而非有无。<sup>[35](https://sqlpedia.org/comparisons/feature-matrix)</sup><sup> • </sup><sup>[36](https://www.devopsschool.com/blog/comparison-of-mysql-mssql-postgresql-and-oracle-database/)</sup> 由于基准结果取决于配置和工作负载，测量文献中的实用建议是：在做出决定之前，用类似于预期应用的模式和查询组合对候选系统进行测试。<sup>[29](https://arxiv.org/abs/2301.01095)</sup>

## References

1. [E. F. Codd (1970). A Relational Model of Data for Large Shared Data Banks. Communications of the ACM 13(6), 377-387.](https://db.dobo.sk/wp-content/uploads/2015/11/Codd_1970_A_relational_model.pdf)
2. [Databases, IEEE Technology Navigator](https://technav.ieee.org/area/databases/)
3. [PostgreSQL: License](https://www.postgresql.org/about/licence/)
4. [MySQL 26.7 Reference Manual: General Information](https://dev.mysql.com/doc/refman/26.7/en/introduction.html)
5. [Editions and Supported Features of SQL Server 2025, Microsoft Learn](https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2025?view=fabric-sqldb)
6. [DB-Engines Ranking of Relational DBMS, October 2026](https://db-engines.com/en/ranking/relational%2Bdbms/all)
7. [Developer survey, Stack Overflow 2025 results aggregated at PG.CENTER](https://pg.center/ecosystem/stackoverflow/)
8. [PostgreSQL: About](https://www.postgresql.org/about/)
9. [What's New in SQL Server 2025, Microsoft Learn](https://learn.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2025?preserve-view=true&view=sql-server-ver17)
10. [Oracle introduces its AI-native database, Oracle AI Database 26ai](https://www.oracle.com/database/ai-native-database-26ai/)
11. [TPC Current Specifications](https://www.tpc.org/tpc_documents_current_versions/current_specifications5.asp?mode=TPC-MEMBER)
12. [Patricia Selinger, IBM History](https://www.ibm.com/history/patricia-selinger)
13. [A History and Evaluation of System R for CACM, IBM Research](https://research.ibm.com/publications/a-history-and-evaluation-of-system-r)
14. [Oracle timeline, 1977-1979 (Profit magazine)](https://www.oracle.com/us/corporate/profit/p27anniv-timeline-151918.pdf)
15. [50 years of the relational database, Oracle](https://www.oracle.com/database/50-years-relational-database/)
16. [A Brief History of PostgreSQL, PostgreSQL Documentation](https://www.postgresql.org/docs/9.1/history.html)
17. [MySQL Commercial License for OEMs, ISVs and VARs](https://www.mysql.com/about/legal/licensing/oem/)
18. [Database Licensing Information User Manual, Oracle AI Database 26ai](https://docs.oracle.com/en/database/oracle/oracle-database/26/dblic/database-licensing-information-user-manual.pdf)
19. [PostgreSQL vs MySQL vs SQL Server vs Oracle (2026), ForgeSQL Blog](https://forgesql.com/blog/how-to-choose-the-right-database)
20. [PostgreSQL Documentation: Glossary (MVCC)](https://www.postgresql.org/docs/current/glossary.html)
21. [PostgreSQL Documentation: Transaction Isolation](https://www.postgresql.org/docs/16/transaction-iso.html)
22. [MySQL Reference Manual: InnoDB Disk I/O](https://dev.mysql.com/doc/refman/9.5/en/innodb-disk-io.html)
23. [Transaction Locking and Row Versioning Guide, Microsoft Learn](https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide?view=sql-server-2017)
24. [MySQL Reference Manual: SET TRANSACTION Statement](https://dev.mysql.com/doc/refman/26.7/en/set-transaction.html)
25. [Introduction to Multitenant Administration, Oracle AI Database 26ai](https://docs.oracle.com/en/database/oracle/oracle-database/26/multi/introduction-to-the-multitenant-architecture.html)
26. [TPC Homepage](https://tpc.org/)
27. [TPC-C Overview](https://tpc.org/tpcc/detail5.asp)
28. [TPC-DS Specification](https://tpc.org/tpc_documents_current_versions/pdf/tpc-ds_v2.13.0.pdf)
29. [Database management system performance comparisons: A systematic literature review, arXiv](https://arxiv.org/abs/2301.01095)
30. [Oracle 19c, SQL Server 2019, PostgreSQL 12 and MySQL 8 database systems comparison, JCSI 17 (2020)](https://ph.pollub.pl/index.php/jcsi/article/download/2281/2153/8533)
31. [PostgreSQL vs SQL Server: Documented Benchmark Across Six Workload Types](https://pg-versus-ms.com/postgresql-vs-sql-server-benchmark-six-workloads/)
32. [DB-Engines Ranking Method](https://db-engines.com/en/ranking_definition)
33. [Technology, 2025 Stack Overflow Developer Survey](https://survey.stackoverflow.co/2025/technology)
34. [PostgreSQL 19 Release Notes (beta)](https://www.postgresql.org/docs/19/release-19.html?trk=article-ssr-frontend-pulse_little-text-block)
35. [Database Engine Feature Matrix, SQLpedia](https://sqlpedia.org/comparisons/feature-matrix)
36. [Comparison of MySQL, MSSQL, PostgreSQL, and Oracle Database, DevOpsSchool](https://www.devopsschool.com/blog/comparison-of-mysql-mssql-postgresql-and-oracle-database/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Database engines and systems › Relational database engines

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/comparison-of-relational-database-management-systems

English original: https://www.edgepedia.org/comparison-of-relational-database-management-systems
