标签
PostgreSQL , Oracle , 兼容性 , 18c
背景
Oracle 18c 发布了诸多新特性, 其中大部分 Oracle 18c 的重大特性, 在早期版本的 PostgreSQL 数据库已支持
如下
一开发特性
1 图式搜索
- Oracle 18c
- SQL-Based Property Graph Query and Analytics
- https://docs.oracle.com/en/database/oracle/oracle-database/18/spgdg/sql-based-property-graph-query-analytics.html#GUID-C5CC6650-0375-4F32-8317-BAF859C1909C
- PostgreSQL 8.4+ (2009 year+)
12009 年 PostgreSQL 社区版本 8.4, 加入 CTE 递归语法的支持, 支持图式搜索
PostgreSQL 图式搜索 (graph search) 实践 - 百亿级图谱, 毫秒响应
PostgreSQL 实践 - 内容社区 (如论坛) 图式搜索应用
小微贷款天使投资 (风控助手) 业务数据库设计(图式搜索 \ 图谱分析) - 阿里云 RDS PostgreSQL, HybridDB for PostgreSQL 最佳实践
22017 年 3 月, 基于 PostgreSQL 的专业图数据库 AgensGraph 发布 1.0, 兼容标准 SQL 和图式搜索语法 openCypher
- AgensGraph supports ANSI-SQL and openCypher (http://www.opencypher.org).
- https://github.com/bitnine-oss/agensgraph
2 JSON 增强
- Oracle 18c
- SQL Enhancements for JSON
支持行转 JSON
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=ADJSN-GUID-8C9B00DD-45D8-499B-919C-8632E034B664
- PostgreSQL 9.2+ (2012 year+)
2012 年 PostgreSQL 社区版本 9.2, 加入 JSON 的支持
https://www.postgresql.org/docs/current/static/datatype-json.html
9.2 已支持行转 JSON
row_to_json(record [, pretty_bool])
除此之外, PostgreSQL 还支持嵌套 JSON,K-V 转 JSON,K-V 类型支持数组类型, LTREE,RANGE,XML,TS,IP 等类型, 对开发更加的友好
- https://www.postgresql.org/docs/devel/static/functions.html
- https://www.postgresql.org/docs/devel/static/hstore.html
- https://www.postgresql.org/docs/current/static/ltree.html
3 空间数据 sharding
Oracle 18c
支持空间数据字段作为 SHARDING 字段
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=SPATL-GUID-1EFFDD77-9666-4190-ACD2-EE3DCA7B326D
- PostgreSQL 8.2+ (2007 year+)
1 早在 2008 年以前, 就可以使用 plproxy 来实现 PostgreSQL sharding, 在 skype 内核心数据库用的就是 plproxy 做的 shardingsharding 算法完全由用户控制, 不管是空间数据还是什么数据, 都可以支持
https://plproxy.github.io/
阿里云 ApsaraDB RDS for PostgreSQL 最佳实践 - 4 水平分库 之 节点扩展
阿里云 ApsaraDB RDS for PostgreSQL 最佳实践 - 3 水平分库 vs 单机 性能
阿里云 ApsaraDB RDS for PostgreSQL 最佳实践 - 2 教你 RDS PG 的水平分库
PostgreSQL 最佳实践 - 水平分库(基于 plproxy)
A Smart PostgreSQL extension plproxy 2.2 practices
使用 Plproxy 设计 PostgreSQL 分布式数据库
2 除了 plproxy 分库分表以外, PostgreSQL 社区还有一些 NewSQL 或 MPP 架构的数据库或插件, 例如 postgres-xl, antdb, citusDB, Greenplum:
- https://github.com/ADBSQL/AntDB
- http://www.postgres-xl.org/
- https://www.citusdata.com/product
- http://www.greenplum.org/
- https://wiki.postgresql.org/wiki/PostgreSQL_derived_databases
32016 年发布的 PostgreSQL 9.6 与 pg_pathman 插件, 支持外部表继承, 同时支持外部表的查询下推, 支持表达式分区这些特性决定了用户可以使用 PostgreSQL 9.6+, pg_pathman, postgis(st_geohash)来实现空间字段的 sharding
PostgreSQL 11 preview - Parallel Append (多表并行计算) sharding 架构并行计算核心功能之一
PostgreSQL 10 + PostGIS + Sharding(pg_pathman) + MySQL(fdw 外部表) on ECS 部署指南(适合新用户)
PostgreSQL 10.0 preview sharding 增强 - 支持分布式事务
PostgreSQL 10.0 preview sharding 增强 - pushdown 增强
PostgreSQL 10.0 preview sharding 增强 - 支持 Append 节点并行
PostgreSQL 10.0 preview sharding 增强 - postgres_fdw 多节点异步并行执行
PostgreSQL 9.6 sharding based on FDW & pg_pathman
PostgreSQL 9.5+ 高效分区表实现 - pg_pathman
PostgreSQL 9.6 sharding + 单元化 (based on postgres_fdw) 最佳实践 - 通用水平分库场景设计与实践
PostgreSQL 9.6 单元化, sharding (based on postgres_fdw) - 内核层支持前传
- 4 Text: Automatic Background Index Maintenance
- Oracle 18c
后台自动维护文本索引
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=CCAPP-GUID-54F2466B-7D05-45AC-A64E-04717F75C507
- PostgreSQL 8.2+ (2007 year+)
PostgreSQL 从 8.2 (2007 年)开始, 支持全文检索, 全文检索索引索引自动维护, 不需要人工干预
PostgreSQL GIN 索引不仅可用于全文检索字段, 同时还支持其他多值类型, 实时 build+pending list(autovacuum), 可调整 pending list size 合并写入写入与查询互不堵塞, 兼顾了写性能和读性能
实际上 PostgreSQL 的设计理念是开放接口, 所以索引接口也是开放的, 因此我们看到 PostgreSQL 已支持的索引接口就达 9 种之多(hash,btree,gin,gist,spgist,brin,bloom,rum,zombdb), 覆盖普通类型, 多值类型, 空间类型, 时序数据, 多字段任意组合搜索, 全文检索, 时空搜索等
PostgreSQL 9 种索引的原理和应用场景
- 5 Text: Wildcard Search
- Oracle 18c
支持通配符匹配
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=CCAPP-GUID-67A2ACB4-FB50-4EEB-9DC0-58BDA85014BA
- PostgreSQL 8.3+ (2008 year+)
严格来说, PostgreSQL 8.2 以前的版本已经支持了通配符搜索,(支持正则表达式)
从 8.3 (2008 年)开始, 支持 pg_trgm, 因此能够支持通配符搜索的索引检索加速目前 Oracle 还做不到模糊查询正则查询全文检索的索引加速 PostgreSQL 可以做到
https://www.postgresql.org/docs/current/static/pgtrgm.html
PostgreSQL 1000 亿数据量 正则匹配 速度与激情
PostgreSQL UDF 实现 tsvector(全文检索), array(数组)多值字段与 scalar(单值字段)类型的整合索引(类分区索引) - 单值与多值类型复合查询性能提速 100 倍 + 案例 (含, 单值 + 多值列合成)
PostgreSQL 相似搜索分布式架构设计与实践 - dblink 异步调用与多机并行(远程 游标 + 记录 UDF 实例)
PostgreSQL 相似搜索设计与性能 - 地址 QAPOI 等文本 毫秒级相似搜索实践
PostgreSQL 全文检索之 - 位置匹配 过滤语法(例如 '速度 <1> 激情')
PostgreSQL 模糊查询 与 正则匹配 性能差异与 SQL 优化建议
PostgreSQL 遗传学应用 - 矩阵相似距离计算 (欧式距离,...XX 距离)
多流实时聚合 - 记录级实时快照 - JSON 聚合与 json 全文检索的功能应用
PostgreSQL - 全文检索内置及自定义 ranking 算法介绍 与案例
用 PostgreSQL 做实时高效 搜索引擎 - 全文检索模糊查询正则查询相似查询 ADHOC 查询
HTAP 数据库 PostgreSQL 场景与性能测试之 17 - (OLTP) 数组相似查询
HTAP 数据库 PostgreSQL 场景与性能测试之 16 - (OLTP) 文本特征向量 - 相似特征 (海明...) 查询
HTAP 数据库 PostgreSQL 场景与性能测试之 14 - (OLTP) 字符串搜索 - 全文检索
HTAP 数据库 PostgreSQL 场景与性能测试之 13 - (OLTP) 字符串搜索 - 相似查询
HTAP 数据库 PostgreSQL 场景与性能测试之 12 - (OLTP) 字符串搜索 - 前后模糊查询
HTAP 数据库 PostgreSQL 场景与性能测试之 9 - (OLTP) 字符串模糊查询 - 含索引实时写入
HTAP 数据库 PostgreSQL 场景与性能测试之 7 - (OLTP) 全文检索 - 含索引实时写入
PostgreSQL 中英文混合分词特殊规则(中文单字英文单词) - 中英分明
多国语言字符串的加密全文检索模糊查询的支持
Greenplum 模糊查询 实践
全文检索 不包含 优化 - 阿里云 RDS PostgreSQL 最佳实践
17 种文本相似算法与 GIN 索引 - pg_similarity
PostgreSQL 模糊查询最佳实践 - (含单字双字多字模糊查询方法)
PostgreSQL 10.0 preview 功能增强 - JSON 内容全文检索
PostgreSQL 结合余弦线性相关算法 在文本图片数组相似 等领域的应用 - 3 rum, smlar 应用场景分析
PostgreSQL 结合余弦线性相关算法 在文本图片数组相似 等领域的应用 - 2 smlar 插件详解
PostgreSQL 结合余弦线性相关算法 在文本图片数组相似 等领域的应用 - 1 文本 (关键词) 分析理论基础 - TF(Term Frequency 词频)/IDF(Inverse Document Frequency 逆向文本频率)
导购系统 - 电商内容去重 \ 内容筛选应用(实时识别转载 \ 盗图 \ 侵权?) - 文本图片集商品集数组相似判定的优化和索引技术
PostgreSQL 全表 全字段 模糊查询的毫秒级高效实现 - 搜索引擎颤抖了
从难缠的模糊查询聊开 - PostgreSQL 独门绝招之一 GIN , GiST , SP-GiST , RUM 索引原理与技术背景
从相似度算法谈起 - Effective similarity search in PostgreSQL
聊一聊双十一背后的技术 - 毫秒分词算啥, 试试正则和相似度
PostgreSQL 全文检索加速 快到没有朋友 - RUM 索引接口(潘多拉魔盒)
PostgreSQL 文本数据分析实践之 - 相似度分析
中文模糊查询性能优化 by PostgreSQL trgm
PostgreSQL 行级 全文检索
使用阿里云 PostgreSQL zhparser 中文分词时不可不知的几个参数
PostgreSQL 百亿数据 秒级响应 正则及模糊查询
PostgreSQL chinese full text search 中文全文检索
PostgreSQL 9.3 pg_trgm imporve support multi-bytes char and gist,gin index for reg-exp search
PostgreSQL 使用 nlpbamboo chinesecfg 中文分词
- 6 Text: Concurrent DML Support
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=CCAPP-GUID-67A2ACB4-FB50-4EEB-9DC0-58BDA85014BA
- PostgreSQL 8.2+ (2007 year+)
PostgreSQL 从 8.2 (2007 年)开始, 支持全文检索, 全文检索索引索引自动维护, 不需要人工干预
PostgreSQL GIN 索引不仅可用于全文检索字段, 同时还支持其他多值类型, 实时 build+pending list(autovacuum), 可调整 pending list size 合并写入写入与查询互不堵塞, 兼顾了写性能和读性能
二 sharding
- 1 User-Defined Sharding Method
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=SHARD-GUID-4FFB5665-B925-4DB6-ACDD-807D6E699365
- PostgreSQL 8.2+ (2007 year+)
1 早在 2008 年以前, 就可以使用 plproxy 来实现 PostgreSQL sharding, 在 skype 内核心数据库用的就是 plproxy 做的 shardingsharding 算法完全由用户控制, 不管是空间数据还是什么数据, 都可以支持
三 Big Data and Data Warehousing
1 Analytic View FILTER FACT and ADD MEASURE Keywords
聚合前, 对输入聚合函数的数据进行过滤, 也就是说支持基于条件聚合并不是 WHERE 条件, 请注意
- Analytic views provide a fast and efficient way to create analytic queries of data stored in existing database tables and views.
- Analytic views organize data using a dimensional model. They allow you to easily add aggregations and calculations to data sets and to present data in views that can be queried with relatively simple SQL.
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=DWHSG-GUID-BEE5DB77-C00D-46F7-8543-F4EE3356BCE2
- PostgreSQL 9.4+ (2014 year+)
- https://www.postgresql.org/docs/10/static/sql-expressions.html#SYNTAX-AGGREGATES
- aggregate_name (expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
- aggregate_name (ALL expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
- aggregate_name (DISTINCT expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
- aggregate_name ( * ) [ FILTER ( WHERE filter_clause ) ]
- aggregate_name ( [ expression [ , ... ] ] ) WITHIN GROUP ( order_by_clause ) [ FILTER ( WHERE filter_clause ) ]
除了 FILTER,PostgreSQL 聚合还支持 ORDER BY, 即输入到聚合函数中的记录可以按顺序进入, 从而影响聚合结果
PostgreSQL 将开放存储接口压缩接口, 意味着以分析视图为代表的维度组织形式存储将来可以支持
- https://commitfest.postgresql.org/17/1283/
- https://commitfest.postgresql.org/17/1294/
- 2 Data Mining
- Oracle 18c
- Exponential Smoothing
- Random Forest
- Neural Network
- Explicit Semantic Analysis extension to classification
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=DMCON-GUID-EABE920F-1196-49C0-89CD-F25E062E16EF
- PostgreSQL 8.4+ (2009 year+)
PostgreSQL 支持语言接口扩展, 例如支持 plpython 存储过程语言因此社区提供了 madlib 插件, 可以用于在 PostgreSQL 内部使用 plpython 函数接口实现机器学习
- 1madlib
- https://github.com/apache/madlib
- http://madlib.apache.org/index.html
[转载]易上手的数据挖掘可视化与机器学习工具: Orange 介绍
一张图看懂 MADlib 能干什么
PostgreSQL 多元线性回归 - 1 MADLib Installed in PostgreSQL 9.2
如果你用的是 PostgreSQL 9.6+, 则支持并行计算, 性能更加而如果你用的是 greenplum(基于 PostgreSQL 的 MPP 数据库)那么就可以支持多机并行的机器学习
2 可视化分析软件 orange3, 同样支持 python 扩展
https://orange.biolab.si/
3 流式计算 pipeline , 支持流式计算阅后即焚或 insert on conflict 实现实时或批量计算
PostgreSQL APP 海量 FEED LOG 实时质量统计 CASE(含 percentile_disc)
Greenplum roaring bitmap 与业务场景 (类阿里云 RDS PG varbitx, 应用于海量用户 实时画像和圈选透视)
SQL 流式案例 - 旋转门压缩(前后计算相关滑窗处理例子)
超时流式处理 - 没有消息流入的数据异常监控
阿里云 RDS PostgreSQL varbitx 实践 - 流式标签 (阅后即焚流式批量计算) - 万亿级, 任意标签圈人, 毫秒响应
多流实时聚合 - 记录级实时快照 - JSON 聚合与 json 全文检索的功能应用
人机客户服务质量 - 实时透视分析 - (多股数据流上下文相关实时分析, 窗口保持)
PostgreSQL 业务数据质量 实时监控 实践
用 PostgreSQL 做实时高效 搜索引擎 - 全文检索模糊查询正则查询相似查询 ADHOC 查询
PostgreSQL 手机行业经营分析决策系统设计 - 实时圈选透视估算
PostgreSQL 流式统计 - insert on conflict 实现 流式 UV(distinct), min, max, avg, sum, count ...
PostgreSQL 异步消息实践 - Feed 系统实时监测与响应(如 电商主动服务) - 分钟级到毫秒级的实现
HTAP 数据库 PostgreSQL 场景与性能测试之 33 - (OLAP) 物联网 - 线性字段区间实时统计
HTAP 数据库 PostgreSQL 场景与性能测试之 32 - (OLTP) 高吞吐数据进出(堆存行扫无需索引) - 阅后即焚(JSON + 函数流式计算)
HTAP 数据库 PostgreSQL 场景与性能测试之 31 - (OLTP) 高吞吐数据进出(堆存行扫无需索引) - 阅后即焚(读写大吞吐并测)
HTAP 数据库 PostgreSQL 场景与性能测试之 27 - (OLTP) 物联网 - FEED 日志, 流式处理 与 阅后即焚 (CTE)
泛电网系统 海量实时计算 + OLTP+OLAP DB 设计 - 阿里云(RDSHybridDB) for PostgreSQL 最佳实践
行为审计日志 (实时索引 / 实时搜索)建模 - 最佳实践 2
(流式 lambda 触发器)实时处理大比拼 - 物联网(IoT)\ 金融, 时序处理最佳实践
行为审计日志 (实时索引 / 实时搜索)建模 - 最佳实践 1
流计算风云再起 - PostgreSQL 携 PipelineDB 力挺 IoT
在 PostgreSQL 中实现 update | delete limit - CTID 扫描实践 (高效阅后即焚)
旋转门数据压缩算法在 PostgreSQL 中的实现 - 流式压缩在物联网监控传感器等场景的应用
"物联网" 流式处理应用 - 用 PostgreSQL 实时处理(万亿每天)
PostgreSQL 流计算指 pipelinedb 实时处理 Kafka 消息流
基于 PostgreSQL 的流式 PipelineDB, 1000 万 / s 实时统计不是梦
4 估值计算 hll 插件, 实现估值计算
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 3
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 2
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 1
[转]流数据库 概率计算概念 - PipelineDB-Probabilistic Data Structures & Algorithms
四 General
- 1 Manual termination of run-away queries
- Oracle 18c
- A SQL query consuming excessive resources, including parallel servers, can be terminated using the ALTER SYSTEM CANCEL SQL statement.
- This feature enables the database administrator to terminate a runaway SQL query using a SQL statement. This frees the system resources consumed by the runaway SQL query so that other SQL queries can use them.
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=ADMIN-GUID-7D8E5E00-515D-4338-8B86-C2044F6D2957
- PostgreSQL 8.0+ (2005 year+)
Name | Return Type | Description |
---|---|---|
pg_cancel_backend(pid int) | boolean | Cancel a backend's current query |
pg_terminate_backend(pid int) | boolean | Terminate a backend |
重点是 runaway sql 的检查这个功能可以结合 OS 来判定因为 PG 是基于进程的模型, 只要看进程的资源消耗和统计就可以可以用 cgroup 进行统计
Linux cgroup - memory 子系统讲解
为什么 cgroup blkio 不能限制分区
Linux cgroup - cpu 与 cpuset 子系统讲解
xfs logdev 完美解决 cgroup iops 限制时 ext4 data=writeback 才能解决的问题
cgroup 告诉你如何计算 PostgreSQL 数据库实例用了多少内存
PostgreSQL 商用版本 EPAS(阿里云 ppas) HTAP 功能之资源隔离管理 - CPU 与刷脏资源组管理
- 2 Inline External Tables
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=ADMIN-GUID-621E5DDE-36D9-4661-9D14-80DE35858C3F
- PostgreSQL 8.4+ (2009 year+)
PostgreSQL 从 8.4 开始支持 FDW 接口, 即 foreign data wrapper 对目标数据源实现这个接口, 就可以访问该数据源作为 PostgreSQL 的一张外表来使用因此在 PostgreSQL 中访问 Oracle 的数据是非常轻松的
目前可访问的数据源不完全列表如下, 包括 普通数据库, NOSQL, 文件, 网络服务, 大数据服务, 搜索引擎, 操作系统, 对象存储, 空间数据库 等, 只要有网络接口的数据源, 都可以访问
- https://wiki.postgresql.org/wiki/Fdw
- Generic SQL Database Wrappers
- Specific SQL Database Wrappers
- NoSQL Database Wrappers
- File Wrappers
- Geo Wrappers
- LDAP Wrappers
- Generic web Wrappers
- Specific Web Wrappers
- Big Data Wrappers
- Column-Oriented Wrappers
- Scientific Wrappers
- Operating System Wrappers
- Exotic Wrappers
RDS PG OSS 外部表文档: https://help.aliyun.com/knowledge_detail/43352.html
HDB PG OSS 外部表文档: https://help.aliyun.com/document_detail/35457.html
- 3 Approximate Top-N Query Processing
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=DWHSG-GUID-07B31A40-6AD9-4843-B5B3-D2424ACE39D5
- PostgreSQL 9.0+ (2010 year+)
使用 hyperloglog 插件, PostgreSQL 可以实现概率计算, 包括 count distinct 的概率计算
- https://github.com/citusdata/postgresql-hll
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 3
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 2
- PostgreSQL hll (HyperLogLog) extension for "State of The Art Cardinality Estimation Algorithm" - 1
[转]流数据库 概率计算概念 - PipelineDB-Probabilistic Data Structures & Algorithms
五 Container Database Architecture
- Container Database Architecture
- Oracle 18c
- https://docs.oracle.com/en/database/oracle/oracle-database/18/newft/new-features.html#GUID-028D54E7-DEDB-44FD-9C42-75725032B697
- PostgreSQL 8.0+ (2005 year+)
PostgreSQL 设计之初就是 PDB 模式, 即一个实例, 多个数据库围绕数据库, 支持多种操作, 如:
1 克隆数据库
- CREATE DATABASE name
- [ [ WITH ] [ OWNER [=] user_name ]
- [ TEMPLATE [=] template ]
- [ ENCODING [=] encoding ]
- [ LC_COLLATE [=] lc_collate ]
- [ LC_CTYPE [=] lc_ctype ]
- [ TABLESPACE [=] tablespace_name ]
- [ ALLOW_CONNECTIONS [=] allowconn ]
- [ CONNECTION LIMIT [=] connlimit ]
- [ IS_TEMPLATE [=] istemplate ] ]
例如
create database new_db with template old_db;
2DUMP 数据库
pg_dump 采用 repeatable read 隔离级别导出, 库级别一致
3IMPORT 数据库
pg_restore
4 快照功能,(9.2+ )
pg_export_snapshot(), 支持导出当前快照
PostgreSQL 9.5 new feature - pg_dump use --snapshot taken by another session (exp. slot, pg_export_snapshot())
PostgreSQL 事务快照功能 - Parallel Export consistent data or Parallel Query use snapshot transaction feature
PostgreSQL 共享事务快照功能 - PostgreSQL 9.2 can share snapshot between multi transactions
5 订阅数据库,(10+ )
通过订阅功能, 支持数据库表级别的逻辑订阅
PostgreSQL 逻辑订阅 - DDL 订阅 实现方法
使用 PostgreSQL 逻辑订阅实现 multi-master
PostgreSQL 逻辑订阅 - 给业务架构带来了什么希望?
PostgreSQL 10.0 preview 逻辑订阅 - 原理与最佳实践
6 内核层面理论是也可以实现针对库级的 WAL
六 Globalization
PostgreSQL 10+ (2017 year+)
支持 ICU 库
- The ICU library has versioning that allows detection of collation changes between versions.
- It is enabled via configure option --with-icu.
- The default still uses the operating system's native collation library.
PostgreSQL 10.0 preview 功能增强 - 国际化功能增强, 支持 ICU(International Components for Unicode)
七分区
- 1 Parallel Partition-Wise SQL Operations
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=DWHSG-GUID-9CEE2551-7E43-472E-9B68-89E738F42C0A
- PostgreSQL 11+ (2018 year+)
PostgreSQL 11 支持分区表的智能 JOIN
PostgreSQL 11 preview - 分区表智能并行 JOIN (已类似 MPP 架构, 性能暴增)
在 PostgreSQL 11 前, 通过 dblink 异步调用, 可以实现同样功能, 不过需要用户自己关注分区定义是否一致
PostgreSQL dblink 异步调用实现 并行 hash 分片 JOIN - 含数据交并差 提速案例 - 含 dblink VS pg 11 parallel hash join VS pg 11 智能分区 JOIN
- 2 Online Merging of Partitions and Subpartitions
- Oracle 18c
- The ONLINE keyword is specified to enable concurrent DML operations while a partition maintenance operation is ongoing.
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=VLDBG-GUID-0E7793F7-B38A-427E-846B-7A8651F2A523
- PostgreSQL 9.5+ (2015 year+)
pg_pathman , 通过这个插件, 可以实现高效的分区管理
https://github.com/postgrespro/pg_pathman
自动或手动分区管理
Both automatic and manual partition management;
自动新增分区, 无需人工干预
Automatic partition creation for new INSERTed data (only for RANGE partitioning);
支持字段或表达式分区
Partitioning by expression and composite key;
将单表转换为分区表时, 不堵塞 DML
- Non-blocking concurrent table partitioning;
- partition_table_concurrently(relation REGCLASS,
- batch_size INTEGER DEFAULT 1000,
- sleep_time FLOAT8 DEFAULT 1.0)
分区表执行计划自动根据分区定义进行优化
Effective query planning for partitioned tables (JOINs, subselects etc);
分区表支持外部数据源
FDW support (foreign partitions);
合并和分裂分区接口例子
- merge_range_partitions(partitions REGCLASS[])
- split_range_partition(partition REGCLASS,
- split_value ANYELEMENT,
- partition_name TEXT DEFAULT NULL)
如果是 PostgreSQL 10+, 则可以使用 SQL 语法来绑定和解绑分区, 结合订阅, DDL 事务功能, 可以实现在线合并分裂分区
https://www.postgresql.org/docs/devel/static/sql-altertable.html
逻辑订阅, ddl 支持事务, detach, attach
- 3 Modifying the Partitioning Strategy
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=VLDBG-GUID-763391C6-44E8-401D-8119-DC12926F5877
- PostgreSQL 10+ (2018 year+)
通过逻辑订阅来实现, 分区定义的修改, 不堵塞 dml
1db2 创建新表
2db1 创建发布
3db1 将旧表添加到发布
4db2 创建订阅
5db2 创建发布
6db2 将新表添加到发布
7db1 创建新表
8db1 创建订阅
9db1 切换新旧表
(目前可能需要借助一个临时库绕一圈, 同一数据库中无法订阅)
八安全
- 1 Integration of Active Directory Services with Oracle Database
- Oracle 18c
- https://www.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-database/18/newft&id=DBSEG-GUID-9739D541-FA9D-422A-95CA-799A4C6F488D
- PostgreSQL 8.2+ (2007 year+)
PostgreSQL 8.2 即引入了 LDAP 的认证
除了 LDAP,PostgreSQL 还支持多种认证接口:
- https://www.postgresql.org/docs/current/static/auth-methods.html
- 20.3.1. Trust Authentication
- 20.3.2. Password Authentication
- 20.3.3. GSSAPI Authentication
- 20.3.4. SSPI Authentication
- 20.3.5. Ident Authentication
- 20.3.6. Peer Authentication
- 20.3.7. LDAP Authentication
- 20.3.8. RADIUS Authentication
- 20.3.9. Certificate Authentication
- 20.3.10. PAM Authentication
- 20.3.11. BSD Authentication
PostgreSQL LDAP 认证之 search bind 配置
PostgreSQL LDAP 认证之 simple bind 配置
PostgreSQL Windows AD 认证配置
小结
PostgreSQL 是一个全栈数据库, 不输于现在的商用数据库, 有非常弹性的许可协议(like BSD), 有非常广泛的行业群众基础, 生态健全
下面是一篇较为全面的 PostgreSQL 数据库介绍:
阿里云 PostgreSQL: 云生态企业案例开发实践管理实践学习资料学习视频
参考
https://docs.oracle.com/en/database/oracle/oracle-database/18/whats-new.html
来源: http://click.aliyun.com/m/42970/