天天看點

【學習視訊】第10期2017-PostgreSQL 應用場景實踐 - 适合架構師與業務開發者

背景

為了能夠讓使用者可以更快的上手PostgreSQL,與雲栖團隊的小夥伴制作了一系列阿裡雲RDS PostgreSQL沙箱實驗。

所有實驗内容都結合了應用場景,非常具有代表性,興趣性與一定的挑戰性。

如果你想自己安裝PG進行如下實踐,可以參考安裝文檔,建議使用PG的最新穩定版(PG每一年會釋出一個大版本,穩定GA):

《PostgreSQL 11 參數模闆 - 珍藏級》 《PostgreSQL 10 + PostGIS + Sharding(pg_pathman) + MySQL(fdw外部表) on ECS 部署指南(适合新使用者) - 珍藏級》

如果你想體系化的學習PG,可以參考:

《PostgreSQL 2天教育訓練大綱》

以及

《PostgreSQL、Greenplum 《如來神掌》》 《阿裡雲 PostgreSQL 産品生态;案例、開發實踐、管理實踐、資料庫原理 - 含學習資料、學習視訊》 《Oracle DBA 轉型 PostgreSQL,Greenplum 學習規劃》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E6%B2%99%E7%AE%B1%E7%AE%80%E4%BB%8B 沙箱簡介

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E5%87%86%E5%A4%87 基礎知識準備

http://www.postgresqltutorial.com/

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%87%86%E5%A4%87 用戶端準備

安裝 postgresql 11用戶端 (需包含psql, pgbench 指令)

https://www.postgresql.org/download/

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E5%BB%BA%E8%AE%AE%E6%B2%99%E7%AE%B1%E8%A7%84%E6%A0%BC 建議沙箱規格

建議要看效果的話,至少來個 RDS PG 11, 4核, 32G, 100G 空間

功能示範,可以小一點的規格

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC1%E6%9C%9Fpostgresql-%E6%9E%84%E9%80%A0%E6%B5%B7%E9%87%8F%E6%95%B0%E6%8D%AE 第1期:PostgreSQL 構造海量資料

知識點:pgbench, plpgsql開發, srf函數

本期視訊講解

相關連結:

1、PostgreSQL 如何快速建構 海量 逼真 測試資料

https://github.com/digoal/blog/blob/master/201711/20171121_01.md https://github.com/digoal/blog/blob/master/201711/readme.md 《PostgreSQL 11 1Kw TPCC , 1億 TPCB 7*24 強壓耐久測試》 《PostgreSQL 11 1萬億 tpcb 性能測試 on 阿裡雲ECS + ESSD + zfs/lvm2條帶 + block_size=32K》 《PostgreSQL 11 1000億 tpcb、1000W tpcc 性能測試 - on 阿裡雲ECS + ESSD (含quorum based 0丢失多副本配置與性能測試)》 《PostgreSQL 11 100億 tpcb 性能測試 on ECS》 《PostgreSQL 11 tpcc 測試(103萬tpmC on ECS) - use sysbench-tpcc by Percona-Lab》 《(TPC-H測試 SF=10,SF=200) PostgreSQL 11 vs 10 vs Deepgreen》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC2%E6%9C%9Fpostgresql-%E7%A7%92%E6%9D%80%E5%9C%BA%E6%99%AF%E5%AE%9E%E8%B7%B5 第2期:PostgreSQL 秒殺場景實踐

知識點:行鎖,等待,ad lock。

1、PostgreSQL 秒殺4種方法 - 增加 批量流式加減庫存 方法

https://github.com/digoal/blog/blob/master/201801/20180105_03.md

2、HTAP資料庫 PostgreSQL 場景與性能測試之 30 - (OLTP) 秒殺 - 高并發單點更新

https://github.com/digoal/blog/blob/master/201711/20171107_31.md

3、聊一聊雙十一背後的技術 - 不一樣的秒殺技術, 裸秒

https://github.com/digoal/blog/blob/master/201611/20161117_01.md

4、PostgreSQL 秒殺場景優化

https://github.com/digoal/blog/blob/master/201509/20150914_01.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC3%E6%9C%9Fpostgresql-%E5%AE%9E%E6%97%B6%E6%90%9C%E7%B4%A2%E5%AE%9E%E8%B7%B5 第3期:PostgreSQL 實時搜尋實踐

知識點:GIN、RUM索引,分詞、pg_trgm、全文檢索、正則、模糊查詢、文本相似搜尋、詞頻統計

1、使用阿裡雲PostgreSQL zhparser中文分詞時不可不知的幾個參數

https://github.com/digoal/blog/blob/master/201603/20160310_01.md

2、用PostgreSQL 做實時高效 搜尋引擎 - 全文檢索、模糊查詢、正則查詢、相似查詢、ADHOC查詢

https://github.com/digoal/blog/blob/master/201712/20171205_02.md

3、PostgreSQL 模糊查詢最佳實踐 - (含單字、雙字、多字模糊查詢方法)

https://github.com/digoal/blog/blob/master/201704/20170426_01.md

4、PostgreSQL 相似搜尋設計與性能 - 位址、QA、POI等文本 毫秒級相似搜尋實踐

https://github.com/digoal/blog/blob/master/201802/20180202_01.md

5、PostgreSQL 相似搜尋分布式架構設計與實踐 - dblink異步調用與多機并行(遠端 遊标+記錄 UDF執行個體)

https://github.com/digoal/blog/blob/master/201802/20180205_03.md

6、HTAP資料庫 PostgreSQL 場景與性能測試之 12 - (OLTP) 字元串搜尋 - 前後模糊查詢

https://github.com/digoal/blog/blob/master/201711/20171107_13.md

7、HTAP資料庫 PostgreSQL 場景與性能測試之 13 - (OLTP) 字元串搜尋 - 相似查詢

https://github.com/digoal/blog/blob/master/201711/20171107_14.md

8、HTAP資料庫 PostgreSQL 場景與性能測試之 14 - (OLTP) 字元串搜尋 - 全文檢索

https://github.com/digoal/blog/blob/master/201711/20171107_15.md

9、HTAP資料庫 PostgreSQL 場景與性能測試之 16 - (OLTP) 文本特征向量 - 相似特征(海明...)查詢

https://github.com/digoal/blog/blob/master/201711/20171107_17.md

10、HTAP資料庫 PostgreSQL 場景與性能測試之 17 - (OLTP) 數組相似查詢

https://github.com/digoal/blog/blob/master/201711/20171107_18.md

11、PostgreSQL 全文檢索 - 詞頻統計

https://github.com/digoal/blog/blob/master/201803/20180309_02.md

12、

《如何加快PostgreSQL結巴分詞pg_jieba加載速度》 《PostgreSQL 11 相似圖像搜尋插件 imgsmlr 性能測試與優化 3 - citus 8機128shard (4億圖像)》 《PostgreSQL 11 相似圖像搜尋插件 imgsmlr 性能測試與優化 2 - 單機分區表 (dblink 異步調用并行) (4億圖像)》 《PostgreSQL 11 相似圖像搜尋插件 imgsmlr 性能測試與優化 1 - 單機單表 (4億圖像)》 《PostgreSQL 相似搜尋插件介紹大彙總 (cube,rum,pg_trgm,smlar,imgsmlr,pg_similarity) (rum,gin,gist)》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC4%E6%9C%9Fpostgresql-%E5%AE%9E%E6%97%B6%E5%A4%9A%E7%BB%B4%E5%88%86%E6%9E%90 第4期:PostgreSQL 實時多元分析

知識點:GIN、RUM索引,任意字段組合查詢,數組相交、包含、相似搜尋

1、PostgreSQL ADHoc(任意字段組合)查詢 與 字典化 (rum索引加速) - 實踐與方案1

https://github.com/digoal/blog/blob/master/201802/20180228_01.md

2、PostgreSQL ADHoc(任意字段組合)查詢(rums索引加速) - 非字典化,普通、數組等組合字段生成新數組

https://github.com/digoal/blog/blob/master/201805/20180518_02.md

3、HTAP資料庫 PostgreSQL 場景與性能測試之 17 - (OLTP) 數組相似查詢

4、HTAP資料庫 PostgreSQL 場景與性能測試之 18 - (OLAP) 使用者畫像圈人場景 - 數組包含查詢與聚合

https://github.com/digoal/blog/blob/master/201711/20171107_19.md

5、HTAP資料庫 PostgreSQL 場景與性能測試之 19 - (OLAP) 使用者畫像圈人場景 - 數組相交查詢與聚合

https://github.com/digoal/blog/blob/master/201711/20171107_20.md

6、HTAP資料庫 PostgreSQL 場景與性能測試之 20 - (OLAP) 使用者畫像圈人場景 - 多個字段任意組合條件篩選與透視

https://github.com/digoal/blog/blob/master/201711/20171107_21.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC5%E6%9C%9Fpostgresql-%E4%BC%B0%E5%80%BC%E6%A6%82%E7%8E%87%E8%AE%A1%E7%AE%97 第5期:PostgreSQL 估值、機率計算

知識點:統計資訊、采樣接口、機率計算插件HLL\CMS_TOPN、滑窗分析、EXPLAIN 估值

1、《秒級任意次元分析1TB級大表 - 通過采樣估值滿足高效TOP N等統計分析需求》

https://github.com/digoal/blog/blob/master/201709/20170911_02.md

2、《PostgreSQL count-min sketch top-n 機率計算插件 cms_topn (結合視窗實作同比、環比、滑窗分析等) - 流計算核心功能之一》

https://github.com/digoal/blog/blob/master/201803/20180301_03.md

3、《PostgreSQL 任意列組合條件 行數估算 實踐 - 采樣估算》

https://github.com/digoal/blog/blob/master/201804/20180403_03.md

4、《妙用explain Plan Rows快速估算行》

https://github.com/digoal/blog/blob/master/201509/20150919_02.md

5、《PostgreSQL pg_stats used to estimate top N freps values and explain rows》

https://github.com/digoal/blog/blob/master/201308/20130811_01.md

6、HLL估值,滑窗分析

https://github.com/aggregateknowledge/postgresql-hll https://github.com/digoal/blog/blob/master/201302/20130226_01.md https://github.com/digoal/blog/blob/master/201302/20130227_01.md https://github.com/digoal/blog/blob/master/201302/20130228_01.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC6%E6%9C%9F%E7%94%A8%E6%88%B7%E7%94%BB%E5%83%8F%E7%B3%BB%E7%BB%9F%E5%AE%9E%E8%B7%B5 第6期:使用者畫像系統實踐

知識點:标簽聚合計算,varbit插件, 異步消費, BIT位計算, dblink異步并行

1、《阿裡雲RDS for PostgreSQL varbitx插件與實時畫像應用場景介紹》

https://github.com/digoal/blog/blob/master/201705/20170502_01.md

2、《基于 阿裡雲RDS PostgreSQL 打造實時使用者畫像推薦系統》

https://github.com/digoal/blog/blob/master/201610/20161021_01.md

3、《阿裡雲RDS PostgreSQL varbitx實踐 - 流式标簽 (閱後即焚流式批量計算) - 萬億級,任意标簽圈人,毫秒響應》

https://github.com/digoal/blog/blob/master/201712/20171212_01.md

4、《驚天性能!單RDS PostgreSQL執行個體 支撐 2000億 - 實時标簽透視案例 (含dblink異步并行調用)》

https://github.com/digoal/blog/blob/master/201712/20171223_01.md

5、

《PostgreSQL 多元空間幾何對象 相交、包含 高效率檢索實踐 - cube》

6、

《PostgreSQL 相似人群圈選,人群擴選,向量相似 使用實踐 - cube》

7、Roaring bitmap 圈選

《Greenplum roaring bitmap與業務場景 (類阿裡雲RDS PG varbitx, 應用于海量使用者 實時畫像和圈選、透視)》 《PostgreSQL (varbit, roaring bitmap) VS pilosa(bitmap庫)》 《Roaring Bitmap - A better compressed bitset》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC7%E6%9C%9Fpostgresql-%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97 第7期:PostgreSQL 并行計算

知識點:并行計算、優化器參數、内置并行與異步并行、自定義并行聚合函數

1、并行計算算法

《PostgreSQL 11 并行計算算法,參數,強制并行度設定》 《PostgreSQL 9.6 并行計算 優化器算法淺析》 《PostgreSQL 9.6 并行計算 優化器算法淺析 - 以及如何強制并行度》 《PostgreSQL 9.6 引領開源資料庫攻克多核并行計算難題》 《分析加速引擎黑科技 - LLVM、列存、多核并行、算子複用 大聯姻 - 一起來開啟PostgreSQL的百寶箱》

2、PG 10 并行計算增強

《PostgreSQL 10.0 preview 功能增強 - 邏輯複制支援并行COPY初始化資料》 《PostgreSQL 10.0 preview 多核并行增強 - 控制叢集并行度》 《PostgreSQL 10.0 preview 多核并行增強 - 索引掃描、子查詢、VACUUM、fdw/csp鈎子》 《PostgreSQL 10.0 preview sharding增強 - 支援Append節點并行》 《PostgreSQL 10.0 preview 多核并行增強 - 并行hash join支援shared hashdata, 節約哈希表記憶體提高效率》 《PostgreSQL 10.0 preview sharding增強 - postgres_fdw 多節點異步并行執行》 《PostgreSQL 10.0 preview 多核并行增強 - tuplesort 多核并行建立索引》

3、PG 11并行計算增強

《PostgreSQL 11 preview - 并行計算 增強 彙總》 《PostgreSQL 11 preview - 分區表智能并行聚合、分組計算(已類似MPP架構,性能暴增)》 《PostgreSQL 11 preview - Parallel Append(包括 union all\分區查詢) (多表并行計算) sharding架構并行計算核心功能之一》 《PostgreSQL 11 preview - 并行排序、并行索引 (性能線性暴增) 單執行個體100億TOP-K僅40秒》 《PostgreSQL 11 preview - 分區表智能并行JOIN (已類似MPP架構,性能暴增)》

4、并行計算壓測(版本10)

《HTAP資料庫 PostgreSQL 場景與性能測試之 23 - (OLAP) 并行計算》

5、dblink 異步調用并行計算

《PostgreSQL dblink異步調用實作 并行hash分片JOIN - 含資料交、并、差 提速案例 - 含dblink VS pg 11 parallel hash join VS pg 11 智能分區JOIN》 《驚天性能!單RDS PostgreSQL執行個體 支撐 2000億 - 實時标簽透視案例 (含dblink異步并行調用)》 《PostgreSQL dblink異步調用實踐,跑并行多任務 - 例如開N個并行背景任務建立索引, 開N個背景任務跑若幹SQL》 《阿裡雲RDS PostgreSQL OSS 外部表實踐 - (dblink異步調用封裝并行) 從OSS并行導入資料》 《PostgreSQL 變态并行拉取單表的方法 - 按塊并行(按行号(ctid)并行) + dblink 異步調用》 《PostgreSQL VOPS 向量計算 + DBLINK異步并行 - 單執行個體 10億 聚合計算跑進2秒》 《PostgreSQL 相似搜尋分布式架構設計與實踐 - dblink異步調用與多機并行(遠端 遊标+記錄 UDF執行個體)》 《阿裡雲RDS PostgreSQL OSS 外部表實踐 - (dblink異步調用封裝并行) 資料并行導出到OSS》 《PostgreSQL 多元、圖像 歐式距離、向量距離、向量相似 查詢優化 - cube,imgsmlr - 壓縮、分段、異步并行》

6、函數并行計算,聚合函數多階段并行計算

《PostgreSQL 11 preview - 多階段并行聚合array_agg, string_agg》 《PostgreSQL Oracle 相容性之 - 自定義并行聚合函數 PARALLEL_ENABLE AGGREGATE》 《PostgreSQL 10 自定義并行計算聚合函數的原理與實踐 - (含array_agg合并多個數組為單個一進制數組的例子)》

7、GPU并行計算

《PostgreSQL GPU 加速(HeteroDB pg_strom) (GPU計算, GPU-DIO-Nvme SSD, 列存, GPU記憶體緩存)》

8、其他

《PostgreSQL 大版本更新方法之一 - 不落地并行導出導入》 《PostGIS 地理資訊、栅格資料 多核并行處理(st_memunion, st_union)》 《PostgreSQL 如何讓 列存(外部列存) 并行起來》 《PostgreSQL 多路并行 xlog 設計》 《PostgreSQL pg_basebackup 并行壓縮備份》 《PostgreSQL 并行邏輯備份與一緻性講解 - PostgreSQL 9.3 parallel pg_dump》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC8%E6%9C%9Fpostgresql-%E7%AE%80%E5%8D%95%E7%A9%BA%E9%97%B4%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5 第8期:PostgreSQL 簡單空間應用實踐

知識點:GiST索引,BRIN索引,BTREE索引。cluster,geometry類型,GEOHASH。近鄰搜尋,點面判斷,電子圍欄。空間索引結構

1、《PostgreSQL 黑科技 - 空間聚集存儲, 内窺GIN, GiST, SP-GiST索引》

https://github.com/digoal/blog/blob/master/201709/20170905_01.md

2、《PostGIS空間索引(GiST、BRIN、R-Tree)選擇、優化 - 阿裡雲RDS PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170820_01.md

3、《萬億級電商廣告 - brin黑科技帶你(最低成本)玩轉毫秒級圈人(視覺挖掘姊妹篇) - 阿裡雲RDS PostgreSQL, HybridDB for PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170823_01.md

4、《PostgreSQL 物流軌迹系統資料庫需求分析與設計 - 包裹俠實時跟蹤與召回》

https://github.com/digoal/blog/blob/master/201704/20170418_01.md

5、《菜鳥末端軌迹(解密支撐每天251億個包裹的資料庫) - 阿裡雲RDS PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170803_01.md

6、《HTAP資料庫 PostgreSQL 場景與性能測試之 29 - (OLTP) 空間應用 - 高并發空間位置更新(含空間索引)》

https://github.com/digoal/blog/blob/master/201711/20171107_30.md

7、《HTAP資料庫 PostgreSQL 場景與性能測試之 5 - (OLTP) 空間應用 - 空間包含查詢(表内多邊形 包含 輸入空間對象)》

https://github.com/digoal/blog/blob/master/201711/20171107_06.md

8、《HTAP資料庫 PostgreSQL 場景與性能測試之 6 - (OLTP) 空間應用 - KNN查詢(搜尋附近對象,由近到遠排序輸出)》

https://github.com/digoal/blog/blob/master/201711/20171107_07.md

9、《PostgreSQL 空間切割(st_split, ST_Subdivide)功能擴充 - 空間對象網格化 (多邊形GiST優化)》

https://github.com/digoal/blog/blob/master/201710/20171005_01.md

10、《PostgreSQL 空間st_contains,st_within空間包含搜尋優化 - 降IO和降CPU(bound box) (多邊形GiST優化)》

https://github.com/digoal/blog/blob/master/201710/20171004_01.md

11、《PostgreSQL multipolygon 空間索引查詢過濾精簡優化 - IO,CPU放大優化》

https://github.com/digoal/blog/blob/master/201711/20171122_03.md

12、《PostgreSQL 電子圍欄的應用場景和性能(大疆、共享裝置、菜鳥。。。)》

https://github.com/digoal/blog/blob/master/201710/20171031_01.md 《PostgreSQL 空間聚合性能 - 行政區、電子圍欄 空間聚合 - 時間、空間熱力圖》 《PostgreSQL 生成空間熱力圖》 《HTAP資料庫 PostgreSQL 場景與性能測試之 47 - (OLTP) 空間應用 - 高并發空間位置更新、多屬性KNN搜尋并測(含空間索引)末端配送、新零售類項目》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC9%E6%9C%9Fpostgresql-%E6%97%B6%E7%A9%BA%E4%B8%9A%E5%8A%A1%E5%AE%9E%E8%B7%B5 第9期:PostgreSQL 時空業務實踐

知識點:時空partial index,時空搜尋。空間複合索引。

1、《空間複合索引加速空間搜尋》

https://github.com/digoal/blog/blob/master/201706/20170620_01.md

2、《時間+空間 實時多元資料透視》

https://github.com/digoal/blog/blob/master/201704/20170413_02.md

3、《PostgreSQL\GPDB 毫秒級海量 時空資料透視 典型案例分享》

https://github.com/digoal/blog/blob/master/201706/20170629_01.md

4、《時間、空間、對象多元屬性 海量資料任意多元 高效檢索 - 阿裡雲RDS PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201707/20170722_01.md

5、《(新零售)商戶網格化(基于位置GIS)營運 - 阿裡雲RDS PostgreSQL、HybridDB for PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170802_02.md 《PostgreSQL pipelinedb 流計算插件 - IoT應用 - 實時軌迹聚合》 《PostgreSQL 實時位置跟蹤+軌迹分析系統實踐 - 單機頂千億軌迹/天》 《PostgreSQL + PostGIS 時态分析》 《PostgreSQL IoT,車聯網 - 實時軌迹、行程實踐 2 - (含index only scan類聚簇表效果)》 《PostgreSQL IoT,車聯網 - 實時軌迹、行程實踐 1》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC10%E6%9C%9Fpostgresql-%E6%97%B6%E7%A9%BA%E6%95%B0%E6%8D%AE%E8%B0%83%E5%BA%A6%E5%AE%9E%E8%B7%B5 第10期:PostgreSQL 時空資料排程實踐

知識點:近鄰查詢,拼車,空間熱點消除

1、《滴滴打車派單系統思考 資料庫設計與實作》

https://github.com/digoal/blog/blob/master/201804/20180414_03.md

2、《PostgreSQL 滴滴派單 高峰區域集中打車沖突優化1 - 宇宙大爆炸理論與PostgreSQL實踐》

https://github.com/digoal/blog/blob/master/201804/20180416_02.md

3、《為什麼geometry+GIST 比 geohash+BTREE更适合空間搜尋 - 多出的不僅僅是20倍性能提升》

https://github.com/digoal/blog/blob/master/201804/20180417_01.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC11%E6%9C%9Fpostgresql-%E5%9C%A8%E7%A4%BE%E4%BA%A4%E5%BA%94%E7%94%A8%E9%A2%86%E5%9F%9F%E7%9A%84%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5 第11期:PostgreSQL 在社交應用領域的最佳實踐

知識點:關系資料,大V熱點,正反向關系,計數器緩存

1、《PCC性能大賽 - facebook\微網誌 like場景 - 資料庫設計與性能壓測》

https://github.com/digoal/blog/blob/master/201705/20170512_02.md

2、《facebook linkbench 測試PostgreSQL社交關系圖譜場景性能》

https://github.com/digoal/blog/blob/master/201609/20160911_01.md

3、《PostgreSQL 社交類好友關系系統實踐 - 正反向關系查詢加速》

https://github.com/digoal/blog/blob/master/201803/20180302_01.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC12%E6%9C%9Fpostgresql-%E7%89%A9%E8%81%94%E7%BD%91%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5 第12期:PostgreSQL 物聯網最佳實踐

知識點:時序資料特性,SCHEMAless設計思路,遞歸調用,規則,流式計算,滑窗聚合

1、《時序資料合并場景加速分析和實作 - 複合索引,視窗分組查詢加速,變态遞歸加速》

https://github.com/digoal/blog/blob/master/201611/20161128_01.md

2、《PostgreSQL 證券行業資料庫需求分析與應用》

https://github.com/digoal/blog/blob/master/201704/20170417_01.md

3、《PostgreSQL 海量時序資料(任意滑動視窗實時統計分析) - 傳感器、人群、物體等對象跟蹤》

https://github.com/digoal/blog/blob/master/201707/20170705_01.md

4、《時序業務,求每個傳感器、對象的最新值(從7秒到7毫秒的優化之旅) - 阿裡雲RDS PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170823_02.md

5、《泛電網系統 海量實時計算+OLTP+OLAP DB設計 - 阿裡雲(RDS、HybridDB) for PostgreSQL最佳實踐》

https://github.com/digoal/blog/blob/master/201708/20170826_01.md

6、《PostgreSQL 在鐵老大訂單系統中的schemaless設計和性能壓測》

https://github.com/digoal/blog/blob/master/201709/20170927_03.md 《HTAP資料庫 PostgreSQL 場景與性能測試之 33 - (OLAP) 物聯網 - 線性字段區間實時統計》 《HTAP資料庫 PostgreSQL 場景與性能測試之 27 - (OLTP) 物聯網 - FEED日志, 流式處理 與 閱後即焚 (CTE)》 《HTAP資料庫 PostgreSQL 場景與性能測試之 24 - (OLTP) 物聯網 - 時序資料并發寫入(含時序索引BRIN)》 《HTAP資料庫 PostgreSQL 場景與性能測試之 15 - (OLTP) 物聯網 - 查詢一個時序區間的資料》 《SQL流式案例 - 旋轉門壓縮(前後計算相關滑窗處理例子)》 《PostgreSQL 三角函數的用法舉例 - 已知3點求任意夾角(旋轉門續)》 《旋轉門資料壓縮算法在PostgreSQL中的實作 - 流式壓縮在物聯網、監控、傳感器等場景的應用》 https://commitfest.postgresql.org/21/1294/

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC13%E6%9C%9Fpostgresql-%E5%9B%BE%E5%BC%8F%E5%85%B3%E7%B3%BB%E6%95%B0%E6%8D%AE%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5 第13期:PostgreSQL 圖式關系資料應用實踐

知識點:圖式關系、遞歸查詢、廣度優先搜尋

1、《PostgreSQL 家譜、族譜類應用實踐 - 圖式關系存儲與搜尋》

https://github.com/digoal/blog/blob/master/201804/20180408_03.md

2、《金融風控、公安刑偵、社會關系、人脈分析等需求分析與資料庫實作 - PostgreSQL圖資料庫場景應用》

https://github.com/digoal/blog/blob/master/201612/20161213_01.md

3、《PostgreSQL 圖式搜尋(graph search)實踐 - 百億級圖譜,毫秒響應》

https://github.com/digoal/blog/blob/master/201801/20180102_04.md

4、《PostgreSQL 遞歸妙用案例 - 分組資料去重與打散》

https://github.com/digoal/blog/blob/master/201804/20180406_01.md

5、《PostgrSQL 遞歸SQL的幾個應用 - 極客與正常人的思維》

https://github.com/digoal/blog/blob/master/201705/20170519_01.md 《PostgreSQL 圖式搜尋(graph search)實踐 - 百億級圖譜,毫秒響應》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC14%E6%9C%9Fpostgresql-%E6%95%B0%E6%8D%AE%E6%B8%85%E6%B4%97%E9%87%87%E6%A0%B7%E8%84%B1%E6%95%8F%E6%89%B9%E5%A4%84%E7%90%86%E5%90%88%E5%B9%B6 第14期:PostgreSQL 資料清洗、采樣、脫敏、批處理、合并

知識點:資料清洗、去重、采樣、脫敏、批處理、合并

1、資料采樣和脫敏實踐

《PostgreSQL 資料采樣與脫敏》

https://github.com/digoal/blog/blob/master/201706/20170602_02.md

《PostgreSQL 巧妙的資料采樣方法》

https://github.com/digoal/blog/blob/master/201609/20160929_01.md

2、資料清洗和去重實踐

《PostgreSQL 資料去重方法大全》

https://github.com/digoal/blog/blob/master/201706/20170602_01.md

《PostgreSQL 重複 資料清洗 優化教程》

https://github.com/digoal/blog/blob/master/201612/20161230_01.md

《車聯網案例,軌迹清洗 - 阿裡雲RDS PostgreSQL最佳實踐 - 視窗函數》

https://github.com/digoal/blog/blob/master/201707/20170722_02.md 《PostgreSQL 分區表、繼承表 記錄去重方法》 《PostgreSQL 遞歸妙用案例 - 分組資料去重與打散》

3、《資料入庫實時轉換 - trigger , rule》

https://github.com/digoal/blog/blob/master/201706/20170619_02.md

4、《PostgreSQL 如何實作批量更新、删除、插入》

https://github.com/digoal/blog/blob/master/201704/20170424_05.md

5、《PostgreSQL upsert功能(insert on conflict do)的用法》

https://github.com/digoal/blog/blob/master/201704/20170424_04.md

6、《PostgreSQL 如何實作upsert與新舊資料自動分離》

https://github.com/digoal/blog/blob/master/201605/20160524_02.md

7、《PostgreSQL 資料rotate用法介紹 - 按時間覆寫曆史資料》

https://github.com/digoal/blog/blob/master/201703/20170321_02.md

8、《PostgreSQL rotate table 自動清理排程 - 限制,觸發器》

https://github.com/digoal/blog/blob/master/201803/20180311_06.md

9、《PostgreSQL 相似文字檢索與去重 - (銀屑病怎麼治?銀屑病怎麼治療?銀屑病怎麼治療好?銀屑病怎麼能治療好?)》

https://github.com/digoal/blog/blob/master/201803/20180329_01.md

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#%E7%AC%AC15%E6%9C%9Fpostgresql-%E6%96%B0%E7%B1%BB%E5%9E%8B%E6%8F%90%E9%AB%98%E5%BC%80%E5%8F%91%E7%94%9F%E4%BA%A7%E5%8A%9B 第15期:PostgreSQL 新類型提高開發生産力

知識點:JSON, ARRAY, RANGE, 幾何, roaring bitmap, varbitx, uuid, domain, 自定義複合類型, cube, imgsmlr, PostGIS, geometry, geograph, raster, ltree, 全文檢索, smlar, 自定義底層類型

https://www.postgresql.org/docs/11/datatype.html

多值字段(數組、多重含義數組、全文檢索) + 單值字段 組合查詢加速案例

1、《PostgreSQL 店鋪營運實踐 - JSON[]數組 内部标簽資料等值、範圍檢索100倍+加速示例 (含,單值+多值列合成)》

https://github.com/digoal/blog/blob/master/201802/20180208_01.md 《PostgreSQL 随機記錄傳回 - 300倍提速實踐 (随機數組下标代替order by random())》 《PostgreSQL 電商業務(任意次元商品圈選應用) - json包range數組的命中優化 - 展開+索引優化》 《PostgreSQL ADHoc(任意字段組合)查詢(rums索引加速) - 非字典化,普通、數組等組合字段生成新數組》

2、《PostgreSQL UDF實作tsvector(全文檢索), array(數組)多值字段與scalar(單值字段)類型的整合索引(類分區索引) - 單值與多值類型複合查詢性能提速100倍+ 案例 (含,單值+多值列合成)》

https://github.com/digoal/blog/blob/master/201802/20180207_02.md

3、《PostgreSQL 多重含義數組檢索與條件過濾 (标簽1:屬性, 标簽n:屬性) - 包括UPSERT操作如何修改數組、追加數組元素》

https://github.com/digoal/blog/blob/master/201801/20180124_02.md

4、《會議室預定系統實踐 - PostgreSQL tsrange(時間範圍類型) + 排他限制》

https://github.com/digoal/blog/blob/master/201712/20171223_02.md

5、《PostgreSQL 黑科技 range 類型及 gist index 20x+ speedup than Mysql index combine query》

https://github.com/digoal/blog/blob/master/201206/20120607_01.md 《PostgreSQL SELECT 的進階用法(CTE, LATERAL, ORDINALITY, WINDOW, SKIP LOCKED, DISTINCT, GROUPING SETS, ...) - 珍藏級》 《PostgreSQL Oracle 相容性之 - nested table》 《導購系統 - 電商内容去重\内容篩選應用(實時識别轉載\盜圖\侵權?) - 文本、圖檔集、商品集、數組相似判定的優化和索引技術》 《阿裡雲RDS PostgreSQL varbitx實踐 - 流式标簽 (閱後即焚流式批量計算) - 萬億級,任意标簽圈人,毫秒響應》 《阿裡雲RDS for PostgreSQL varbitx插件與實時畫像應用場景介紹》 《地理位置畫像、連鎖店圈人、地理圍欄圈人、多地圈選、multi-polygon圈選、多點圈選》 相似人群圈選-視訊講解 《PostgreSQL cube 插件 - 多元空間對象》 多元空間計算視訊講解 《海量資料,海明(simhash)距離高效檢索(smlar) - 阿裡雲RDS PosgreSQL最佳實踐》 《PostgreSQL結合餘弦、線性相關算法 在文本、圖檔、數組相似 等領域的應用 - 3 rum, smlar應用場景分析》 《PostgreSQL結合餘弦、線性相關算法 在文本、圖檔、數組相似 等領域的應用 - 2 smlar插件詳解》 《PostgreSQL結合餘弦、線性相關算法 在文本、圖檔、數組相似 等領域的應用 - 1 文本(關鍵詞)分析理論基礎 - TF(Term Frequency 詞頻)/IDF(Inverse Document Frequency 逆向文本頻率)》 《PostgreSQL 樹狀資料存儲與查詢(非遞歸) - Use ltree extension deal tree-like data type》 《經營、銷售分析系統DB設計之PostgreSQL, Greenplum - 共享充電寶 案例實踐》

https://github.com/digoal/blog/blob/master/201805/20180524_02.md#postgresql-%E8%AE%B8%E6%84%BF%E9%93%BE%E6%8E%A5 https://github.com/digoal/blog/issues/76