cstore_fdwPostgreSQL 柱狀存儲擴展
cstore_fdw 實現(xiàn)了 PostgreSQL 數(shù)據(jù)庫的柱狀存儲,用于對批量加載的數(shù)據(jù)進行分析的場景。
該擴展使用了 Optimized Row Columnar (ORC) 格式的數(shù)據(jù)存儲布局。ORC 提升 Facebook 開發(fā)的 RCFile 格式,帶來如下好處:
-
壓縮: Reduces in-memory and on-disk data size by 2-4x. Can be extended to support different codecs.
-
列預測: Only reads column data relevant to the query. Improves performance for I/O bound queries.
-
跳過索引: Stores min/max statistics for row groups, and uses them to skip over unrelated rows.
此外,我們使用了 PostgreS 外部數(shù)據(jù)封裝 API 和類型呈現(xiàn),帶來:
-
Support for 40+ Postgres data types. The user can also create new types and use them.
-
Statistics collection. PostgreSQL's query optimizer uses these stats to evaluate different query plans and pick the best one.
-
Simple setup. Create foreign table and copy data. Run SQL.
