|
| 1 | +## 透过postgrespro看PostgreSQL的附加功能 |
| 2 | + |
| 3 | +### 作者 |
| 4 | +digoal |
| 5 | + |
| 6 | +### 日期 |
| 7 | +2017-09-13 |
| 8 | + |
| 9 | +### 标签 |
| 10 | +PostgreSQL , postgrespro , oleg |
| 11 | + |
| 12 | +---- |
| 13 | + |
| 14 | +## 背景 |
| 15 | +[Postgrespro](https://postgrespro.com)是俄罗斯的一家数据库公司,创始人OLEG是PostgreSQL社区的核心成员之一,一名在俄罗斯莫斯科国立大学,斯特恩伯格天文研究所做科学研究的天文学家。同时也担任Postgres Professional公司的首席执行官。也是一位登顶过珠峰的人。 |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +这里是他的专访 |
| 20 | + |
| 21 | +https://yq.aliyun.com/articles/60800 |
| 22 | + |
| 23 | +postgrespro企业版本加了很多新的功能,postgrespro本身也是非常开放的一家公司,期待这些功能会加入到社区版本中。 |
| 24 | + |
| 25 | +https://github.com/postgrespro/ |
| 26 | + |
| 27 | +另一家俄罗斯的公司[ispras](https://github.com/ispras)也放出过非常前沿的产品,Postgres-LLVM,目前JIT已经集成到PostgreSQL社区版本了。 |
| 28 | + |
| 29 | +感谢所有为PostgreSQL社区付出的人们。 |
| 30 | + |
| 31 | +## Postgrespro vs PostgreSQL |
| 32 | + |
| 33 | +Postgres Pro Enterprise is the most actual PostgreSQL version with some additional patches applied and extensions added. Mostly, these are patches already accepted by the PostgreSQL community and committed into PostgreSQL. Also there some patches and extensions developed by Postgres Professional. Users of Postgres Pro Enterprise thus have early access to some important features and fixes. |
| 34 | + |
| 35 | +Currently the difference between Postgres Pro Enterprise and PostgreSQL is the following: |
| 36 | + |
| 37 | +- Performance improvement on multicore systems (buffer manager and locks optimization) |
| 38 | +多核性能增强(BUFFER管理和锁管理优化) |
| 39 | + |
| 40 | +- Full text search improvements: phrase search, hunspell morphology, some dictionaries are bundled with distribution and can be enabled by a single SQL statement, [shared_ispell](https://postgrespro.com/docs/postgresproee/9.6/shared-ispell.html) allowing to store dictionaries in shared memory |
| 41 | +全文检索增强,支持phrase搜索等。 |
| 42 | + |
| 43 | +- Covering indexes |
| 44 | +[《PostgreSQL 10.0 preview 功能增强 - 唯一约束+附加字段组合功能索引》](../201703/20170312_23.md) |
| 45 | + |
| 46 | +- libicu support on all platforms, providing platform-independent sort for various locales |
| 47 | +[《PostgreSQL 10.0 preview 功能增强 - 国际化功能增强,支持ICU(International Components for Unicode)》](../201703/20170330_04.md) |
| 48 | + |
| 49 | +- [pg_trgm](https://postgrespro.com/docs/postgresproee/9.6/pgtrgm.html) module supporting fuzzy string comparison and substring search |
| 50 | +支持fuzzy字符串搜索,substring搜索。(模糊、正则) |
| 51 | + |
| 52 | +- Improved [pageinspect](https://postgrespro.com/docs/postgresproee/9.6/pageinspect.html) module provides access to internal data storage structure |
| 53 | +增强:支持观测gin, sp-gist, gist等索引内部内容 |
| 54 | + |
| 55 | +- [sr_plan](https://postgrespro.com/docs/postgresproee/9.6/sr-plan.html) module allows to save and restore query plans |
| 56 | +支持执行计划的存储和还原。通过这个可以改写SQL的执行计划,甚至可以把SELECT改写成INSERT等或者完全不相关的SQL。 |
| 57 | +[《PostgreSQL Oracle 兼容性之 - SQL OUTLINE插件sr_plan (保存、篡改、固定 执行计划)》](../201702/20170228_01.md) |
| 58 | + |
| 59 | +- [dump_stat](https://postgrespro.com/docs/postgresproee/9.6/dump-stat.html) module allowing to save and restore database statistics when dumping/restoring the database |
| 60 | +允许导出和还原统计信息,相当于将统计信息和数据分开了,这样做的好处是做迁移可以更快。 |
| 61 | +例如pg_upgrade升级版本,可以通过这种方法直接导入统计信息。对于超级大库,这个效率高很多。 |
| 62 | +又比如逻辑备份和还原,可以关闭autovacuum,然后通过这种方式导入统计信息。 |
| 63 | + |
| 64 | +- [jsquery](https://postgrespro.com/docs/postgresproee/9.6/jsquery.html) module provides a specific language for effective index-supported querying of JSONB data |
| 65 | +jsonb的扩展函数、操作符。 |
| 66 | + |
| 67 | +- [pg_variables](https://postgrespro.com/docs/postgresproee/9.6/pg-variables.html) module provides functions to work with variables of various types |
| 68 | +内存表。 |
| 69 | +[《PostgreSQL 内存表》](../201608/20160818_01.md) |
| 70 | + |
| 71 | +- [pg_pathman](https://postgrespro.com/docs/postgresproee/9.6/pg-pathman.html) module provides optimized partitioning mechanism and functions to manage partitions |
| 72 | +分区表插件,支持range,list,hash等分区方法,而且对性能损耗极小。 |
| 73 | +[《PostgreSQL 9.5+ 高效分区表实现 - pg_pathman》](../201610/20161024_01.md) |
| 74 | + |
| 75 | +- [pg_query_state](https://postgrespro.com/docs/postgresproee/9.6/pg-query-state.html) module provides a facility to know the current state of query execution on working backend |
| 76 | +[《官人要杯咖啡吗? - PostgreSQL实时监测PLAN tree的执行进度 - pg_query_state》](../201612/20161208_01.md) |
| 77 | + |
| 78 | +- [pg_probackup](https://postgrespro.com/docs/postgresproee/9.6/app-pgprobackup.html) is a backup and recovery manager |
| 79 | +支持块级增量备份、备份集的管理、恢复。类似Oracle RMAN。 |
| 80 | + |
| 81 | +- [mchar](https://postgrespro.com/docs/postgresproee/9.6/mchar.html) module provides additional data type to compatibility with Microsoft SQL Server |
| 82 | +兼容SQL Server的数据类型。 |
| 83 | + |
| 84 | +- [fulleq](https://postgrespro.com/docs/postgresproee/9.6/fulleq.html) module provides additional equivalence operator to compatibility with Microsoft SQL Server |
| 85 | +兼容SQL Server的等于操作符。 |
| 86 | + |
| 87 | +- [fasttrun](https://postgrespro.com/docs/postgresproee/9.6/fasttrun.html) module provides transaction unsafe function to truncate temporary tables without growing pg_class size |
| 88 | +outer temp table,不造成pg_class, pg_attribute的变更。 |
| 89 | +目前PG的temp table是会话级,每次使用都会擦写pg_class, pg_attribute,产生系统表垃圾。需要autovacuum自动回收这些垃圾。 |
| 90 | + |
| 91 | +- [online_analyze](https://postgrespro.com/docs/postgresproee/9.6/online-analyze.html) module provides set of changes, which immediately update stats after INSERT, UPDATE, DELETE or SELECT INTO operations applied for affected tables |
| 92 | +和autovacuumm的analyze工作差不多。 |
| 93 | + |
| 94 | +- [plantuner](https://postgrespro.com/docs/postgresproee/9.6/plantuner.html) module provides hits for planner, which can do disable or enable indexes for query execution |
| 95 | +sql hint,类似Oracle hint功能。强制设置SQL的执行计划。 |
| 96 | + |
| 97 | +- Added k-nearest neighbors algorithm (KNN) for SP-GiST and B-tree (See [Chapter 61](https://postgrespro.com/docs/postgresproee/9.6/spgist.html)) |
| 98 | +sp-gist,btree索引的KNN检索支持。例如通过sp-gist,btree索引求某个点附近的对象,某个数值、字符串最近的对象。等。 |
| 99 | + |
| 100 | +- Added RUM index, based on GIN, as separate module (See [Section F.53](https://postgrespro.com/docs/postgresproee/9.6/rum.html)) |
| 101 | +RUM索引接口,用于多值类型、全文检索等。支持全文检索的附加列搜索。类似多级树。 |
| 102 | +[《PostgreSQL 全文检索加速 快到没有朋友 - RUM索引接口(潘多拉魔盒)》](../201610/20161019_01.md) |
| 103 | + |
| 104 | +- WAL size has been reduced on CREATE INDEX operation in the GiST, GIN, SP-GiST |
| 105 | + |
| 106 | +- Added timeout for idle sessions on the server side (See [idle_session_timeout](https://postgrespro.com/docs/postgresproee/9.6/runtime-config-client.html#guc-idle-session-timeout)) |
| 107 | +会话超时功能。 |
| 108 | + |
| 109 | +- Added SHA-2 algorithm for password encryption (See [Section 20.3.2](https://postgrespro.com/docs/postgresproee/9.6/auth-methods.html#auth-password)) |
| 110 | +一种新的认证机制,已经添加到10的版本,认证过程更加安全。以往的版本泄露用户密码的md5是有问题的。 |
| 111 | +[《PostgreSQL 10.0 preview 安全增强 - SASL认证方法 之 scram-sha-256 安全认证机制》](../201703/20170309_01.md) |
| 112 | +[《PostgreSQL md5 对比 MySQL - 秘钥认证》](../201610/20161009_01.md) |
| 113 | + |
| 114 | +- Added page level compression (CFS) (See [Chapter 32](https://postgrespro.com/docs/postgresproee/9.6/cfs.html)) |
| 115 | +页级压缩。 |
| 116 | +[《PostgreSQL 透明加密(TDE,FDE) - 块级加密》](../201610/20161031_01.md) |
| 117 | + |
| 118 | +- Added support of autonomous transactions (See [Chapter 16](https://postgrespro.com/docs/postgresproee/9.6/atx.html)) |
| 119 | +支持匿名事务,以往需要通过dblink来支持类似的功能。 |
| 120 | + |
| 121 | +- Added new optional background worker to schedule tasks by rules (See [pgpro_scheduler](https://postgrespro.com/docs/postgresproee/9.6/pgpro-scheduler.html)) |
| 122 | +支持数据库任务调度。类似Oracle的JOB或scheduler功能。 |
| 123 | +以往需要通过pgagent来实现,或者通过系统的调度如crontab来实现。 |
| 124 | + |
| 125 | +- Added support for relocatable tables (See [pg_transfer](https://postgrespro.com/docs/postgresproee/9.6/pgtransfer.html)) |
| 126 | +文件级表传输特性。例如需要将一个表拷贝到其他数据库实例,不需要导出导入,直接拷贝文件。 |
| 127 | +[《PostgreSQL 的表传输功能》](../201706/20170601_03.md) |
| 128 | +如果能做到库级,那么就类似Oracle 12C的PDB了,可以热插拔数据库。 |
| 129 | +加上库级物理恢复,则可以做到更强的插拔体验。 |
| 130 | + |
| 131 | +- Extension [pg_hint_plan](https://postgrespro.com/docs/postgresproee/9.6/pg-hint-plan.html) has been added |
| 132 | +同样是一个SQL HINT插件。 |
| 133 | +[《关键时刻HINT出彩 - PG优化器的参数优化、执行计划固化CASE》](../201607/20160723_02.md) |
| 134 | + |
| 135 | +- Transaction IDs on 64-bit platforms use 64-bit data type |
| 136 | +终于支持64位xid了,不再需要freeze了。虽然PG 10的freeze在静态表层面已经基本不耗费资源了。 |
| 137 | + |
| 138 | +- Lazy placement of temporary tables on disk |
| 139 | + |
| 140 | +- Consistent read on slaves (wait for WAL apply, see [WAITLSN](https://postgrespro.com/docs/postgresproee/9.6/sql-waitlsn.html)) |
| 141 | +备库lsn栅栏,可以做到备库的读一致性。 |
| 142 | +[《PostgreSQL 10.0 preview 功能增强 - slave支持WAITLSN 'lsn', time;用于设置安全replay栅栏》](../201703/20170312_18.md) |
| 143 | + |
| 144 | +- Utility [pg_repack](https://postgrespro.com/docs/postgresproee/9.6/app-pgrepack.html) has been added |
| 145 | +收缩空间的工具,比vacuum full的锁时间更短,类似mysql online ddl. |
| 146 | +[《PostgreSQL 收缩膨胀表或索引 - pg_squeeze or pg_repack》](../201610/20161030_02.md) |
| 147 | + |
| 148 | +- Added [multimaster](https://postgrespro.com/docs/postgresproee/9.6/multimaster.html) extension |
| 149 | +multi master,无需多言,很牛逼的功能。 |
| 150 | + |
| 151 | +- Added failover algorithm for libpq connections |
| 152 | +libpq支持配置多主机,以及failover算法。 |
| 153 | + |
| 154 | +- Added [aqo](https://postgrespro.com/docs/postgresproee/9.6/aqo.html) extension for adaptive query optimization |
| 155 | +基于机器学习算法的优化器功能。 |
| 156 | +[《数据库优化器原理 - 如何治疗选择综合症》](../201705/20170507_01.md) |
| 157 | + |
| 158 | +- Implemented declarative syntax for partitioning. (See [Section F.38.2.6.](https://postgrespro.com/docs/postgresproee/9.6/pg-pathman.html#pg-pathman-using-declarative-syntax)) |
| 159 | +支持创建分区表。 |
| 160 | + |
| 161 | +- Added mamonsu monitoring service, which is implemented as a Zabbix agent. (See [mamonsu.](https://postgrespro.com/docs/postgresproee/9.6/mamonsu.html)) |
| 162 | +支持zabbix agent。 |
| 163 | + |
| 164 | +- Added [pg_wait_sampling](https://postgrespro.com/docs/postgresproee/9.6/pg-wait-sampling.html) extension for sampling-based statistics of wait events. With this extension, you can get an insight into the server activity, including the current wait events for all processes and background workers. |
| 165 | +支持等待事件的采样分析。 |
| 166 | + |
| 167 | +- pg_tsparser module is an alternative text search parser. |
| 168 | +新增一个全文检索parser: pg_tsparser。 |
| 169 | + |
| 170 | +Postgres Pro Enterprise releases are following the PostgreSQL releases, though sometimes occur more frequently. The Postgres Pro Enterprise versioning scheme is based on the PostgreSQL one and has an additional decimal place. |
| 171 | + |
| 172 | + |
| 173 | +## 参考 |
| 174 | + |
| 175 | +https://github.com/ispras |
| 176 | + |
| 177 | +https://postgrespro.com/docs/postgresproee/9.6/intro-pgpro-vs-pg.html |
| 178 | + |
0 commit comments