cstore_fdwPostgreSQL 柱狀存儲(chǔ)擴(kuò)展
cstore_fdw 實(shí)現(xiàn)了 PostgreSQL 數(shù)據(jù)庫(kù)的柱狀存儲(chǔ),用于對(duì)批量加載的數(shù)據(jù)進(jìn)行分析的場(chǎng)景。
該擴(kuò)展使用了 Optimized Row Columnar (ORC) 格式的數(shù)據(jù)存儲(chǔ)布局。ORC 提升 Facebook 開(kāi)發(fā)的 RCFile 格式,帶來(lái)如下好處:
-
壓縮: Reduces in-memory and on-disk data size by 2-4x. Can be extended to support different codecs.
-
列預(yù)測(cè): Only reads column data relevant to the query. Improves performance for I/O bound queries.
-
跳過(guò)索引: Stores min/max statistics for row groups, and uses them to skip over unrelated rows.
此外,我們使用了 PostgreS 外部數(shù)據(jù)封裝 API 和類型呈現(xiàn),帶來(lái):
-
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.
