PostgreSQL vs. MySQL

资料地址:https://www.postgresqltutorial.com/postgresql-vs-mysql/

 PostgreSQLMySQL
Known asThe world’s most advanced open source database.The world’s most popular open source database.
DevelopmentPostgreSQL is an open source project.MySQL is an open-source product.
Pronunciationpost gress queue ellmy ess queue ell
LicensingMIT-style licenseGNU General Public License
Implementation programming languageCC/C++
GUI toolPgAdminMySQL Workbench
ACIDYesYes
Storage engineSingle storage engineMultiple storage engines e.g., InnoDB and MyISAM
Full-text searchYesYes (Limited)
Drop a temporary tableNo TEMP or TEMPORARY keyword in DROP TABLE statementSupport the TEMP or TEMPORARY keyword in the DROP TABLE statement that allows you to remove the temporary table only.
DROP TABLESupport CASCADE option to drop table’s dependent objects e.g., tables and views.Does not support CASCADE option.
 TRUNCATE TABLE PostgreSQL TRUNCATE TABLEsupports more features like CASCADERESTART IDENTITYCONTINUE IDENTITY, transaction-safe, etc.MySQL TRUNCATE TABLE does not support CASCADEand transaction safe i.e,. once data is deleted, it cannot be rolled back.
Auto increment Column SERIAL AUTO_INCREMENT
Identity ColumnYesNo
Analytic functionsYesNo
Data typesSupport many advanced types such as arrayhstore, and user-defined type.SQL-standard types
Unsigned integerNoYes
Boolean typeYesUse TINYINT(1) internally for Boolean
IP address data typeYesNo
Set default value for a columnSupport both constant and function callMust be a constant or CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns
CTEYesYes (Supported CTE since MySQL 8.0)
 EXPLAIN outputMore detailedLess detailed
Materialized viewsYesNo
CHECK constraintYesYes (Supported since MySQL 8.0.16, Before that MySQL just ignored the CHECK constraint)
Table inheritanceYesNo
Programming languages for stored proceduresRuby, Perl, Python, TCL, PL/pgSQL, SQL, JavaScript, etc.SQL:2003 syntax for stored procedures
 FULL OUTER JOINYesNo
 INTERSECTYesNo
 EXCEPTYesNo
Partial indexesYesNo
Bitmap indexesYesNo
Expression indexesYesNo
Covering indexesYes (since version 9.2)Yes. MySQL supports covering indexes that allow data to be retrieved by scanning the index alone without touching the table data. This is advantageous in case of large tables with millions of rows.
TriggersSupport triggers that can fire on most types of command, except for ones affecting the database globally e.g., roles and tablespaces.Limited to some commands
PartitioningRANGE, LISTRANGE, LIST, HASH, KEY, and composite partitioning using a combination of RANGE or LIST with HASH or KEY subpartitions
Task SchedulepgAgentScheduled event
Connection ScalabilityEach new connection is an OS processEach new connection is an OS thread
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值