你的位置:首页 > 软件开发 > 数据库 > cstore_fdw的安装使用以及源码分析

cstore_fdw的安装使用以及源码分析

发布时间:2016-12-06 10:00:22
一、cstore_fdw的简介  https://github.com/citusdata/cstore_fdw,此外部表扩展是由citusdata公司开发,使用RC_file格式对数据进行列式存储。    优点1:因为有压缩,所以在disk上的存储大大减少,压缩比能达到2-4倍 ...

一、cstore_fdw的简介

  https://github.com/citusdata/cstore_fdw,此外部表扩展是由citusdata公司开发,使用RC_file格式对数据进行列式存储。

  

  优点1:因为有压缩,所以在disk上的存储大大减少,压缩比能达到2-4倍

  优点2:数据内部分块存储,对于块数据进行了max以及min值的记录,在查询时能够进行跳块查询

  优点3:在进行查询时,并不是将所有的磁盘数据都load到内存,而是选择列根据记录的skiplist中的offset来load所需要的数据,减少IO

二、安装使用

  [root@centos01 ~]# git clone https://github.com/citusdata/cstore_fdw.git

  下载好后修改Makefile文件中的pgconfig指定到安装目录下 例如:/usr/local/postgres/bin/pgconfig

  [root@centos01 ~]# make && make install

  配置postgres.conf文件末尾添加:

  shared_preload_libraries = 'cstore_fdw'

  启动数据库

  [postgres@centos01 ~]$ pg_ctl -D db1 -l logfile start -m fast

  [postgres@centos01 ~]$ psql

  

postgres=# create extension cstore_fdw;CREATE EXTENSIONpostgres=# create server cstore_server foreign data wrapper cstore_fdw ;CREATE SERVERpostgres=# CREATE FOREIGN TABLE customer_reviewspostgres-# (postgres(#   customer_id TEXT,postgres(#   review_date DATE,postgres(#   review_rating INTEGER,postgres(#   review_votes INTEGER,postgres(#   review_helpful_votes INTEGER,postgres(#   product_id CHAR(10),postgres(#   product_title TEXT,postgres(#   product_sales_rank BIGINT,postgres(#   product_group TEXT,postgres(#   product_category TEXT,postgres(#   product_subcategory TEXTpostgres(# )postgres-# SERVER cstore_serverpostgres-# OPTIONS(compression 'pglz');

原标题:cstore_fdw的安装使用以及源码分析

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录