PG外部資料來源的列式儲存

2021-10-23 22:51:26 字數 1898 閱讀 9485

1 安裝軟體

yum -y install protobuf protobuf-c protobuf-c-devel openssl openssl-devel
2 安裝cstore_fdw

git clone

--修改makefile中的pg_config值為pg_config所在的目錄

--執行make && make install

3 修改資料庫配置檔案postgresql.conf並重啟資料庫服務

shared_preload_libraries = 『cstore_fdw』

4 登入資料庫建立擴充套件和服務

create extension cstore_fdw;
5 建立普通表和外部表

--普通表

create table customer

( customer_id text,

review_date date,

review_rating integer,

review_votes integer,

review_helpful_votes integer,

product_id char(10),

product_title text,

product_sales_rank bigint,

product_group text,

product_category text,

product_subcategory text,

similar_product_ids char(10)

);--外部表

create foreign table customer_reviews

( customer_id text,

review_date date,

review_rating integer,

review_votes integer,

review_helpful_votes integer,

product_id char(10),

product_title text,

product_sales_rank bigint,

product_group text,

product_category text,

product_subcategory text,

similar_product_ids char(10)

)server cstore_server

options(compression 'pglz');

6 拷貝資料到普通表

copy customer to '/home/highgo/customer_data.csv' with csv;
7 向外部表中插入同樣的資料

insert into customer_reviews select * from customer;
8 查詢普通表所佔磁碟大小

9 查詢經過列式儲存的表佔磁碟的大小

grails讀取外部資料來源遇到的坑

親自試驗有2中辦法 1.在專案config.groovy新增需要載入的配置檔案,如開發環境下配置 datasource dev.properties檔案如下填寫 datasource.url jdbc mysql datasource.username x datasource.password x...

外部資料來源的使用彙總二

對於以上分類,我們單獨挑幾個資料維度解釋下,其中 公安資訊 身份證二要素 身份證號 姓名 從身份證和姓名的資訊,返回個人的資訊匹配情況,是否存在該身份證資訊 比對 oc認證,虛假身份證等偽冒風險的克星 公安黑名單 不良犯罪記錄 在第一條的基礎上,是否還能檢測到該身份證有名字公安庫中的不良犯罪記錄等,...

WPF 的 資料來源屬性 和 資料來源

一 資料來源 資料物件 屬性 path 或 path的值 path vm.property或m.property 通常具有通知功能 特例除外 二 path不能孤立而存在,它一定具有所歸屬的資料來源,一定要找到path 確切的說 是它的值 所歸屬的資料來源,說明如下 資料來源 資料物件 1 指定控制項...