greenplum建表策略详解
建表语法:
CREATE [[GLOBAL | LOCAL] {TEMPORARY | TEMP}] TABLE table_name (
[ { column_name data_type [ DEFAULT default_expr ] [column_constraint [ ... ]
[ ENCODING ( storage_directive [,...] ) ]
] | table_constraint| LIKE other_table [{INCLUDING | EXCLUDING} {DEFAULTS | CONSTRAINTS}] ...}[, ... ] ][column_reference_storage_directive [, ... ])[ INHERITS ( parent_table [, ... ] ) ][ WITH ( storage_parameter=value [, ... ] )[ ON COMMIT {PRESERVE ROWS | DELETE ROWS | DROP} ][ TABLESPACE tablespace ][ DISTRIBUTED BY (column, [ ... ] ) | DISTRIBUTED RANDOMLY ][ PARTITION BY partition_type (column)[ SUBPARTITION BY partition_type (column) ] [ SUBPARTITION TEMPLATE ( template_spec ) ]( partition_spec ) | [ SUBPARTITION BY partition_type (column) ]( partition_spec [ ( subpartition_spec) ] )
普通heap表
CREATE TABLE test(id int,num int
)
distribute by id;
普通AO表
CREATE TABLE test(id int,num int
)
with
(appendonly=true)
distribute by id;
AO表压缩行存
CREATE TABLE test(id int,num int
)
with
(appendonly=true,compresslevel=5)
distribute by id;
AO表压缩列存
CREATE TABLE test(id int,num int
)
with
(appendonly=true, orientation=column,compresslevel=5)
distribute by id;
AO表列存压缩存储
CREATE TABLE test(id int,num int
)
with
(appendonly=true, orientation=column,compresstype=zlib,compresslevel=5)
distribute by id;
--compresslevel:取值为1~9,一般取5即可,数值越大压缩率越高
分区表列表分区
CREATE TABLE test(id int,sex int,
)
with
(appendonly=true,compresslevel=5,orientation=true,compresstype=zlib)
partition by list(num)
(subpartition man value('m'),subpartition famal value('f'),default subpartition other
)
distribute by id;
分区表范围分区
--方式一
CREATE TABLE test(id int,ts date,
)
with
(appendonly=true,compresslevel=5,orientation=true,compresstype=zlib)
partition by range(ts)
(start (1) end (31) every(1),default partition none
)
distribute by id;
--方式二
CREATE TABLE test(id int,ts date,
)
with
(appendonly=true,compresslevel=5,orientation=true,compresstype=zlib)
partition by range(ts)
(partition t1 start('2018-01-09') end ('2018-09-10'),partition t2 start('2018-09-11') end ('2019-09-10'),default partition other
)
distribute by id;
--方式三
CREATE TABLE test(id int,ts date,
)
with
(appendonly=true,compresslevel=5,orientation=true,compresstype=zlib)
partition by range(ts)
(start (ts '2018-01-01') inclusiveend (ts '2019-01-01') exclusiveevery (interval '7 day')
)
distribute by id;
greenplum建表策略详解相关推荐
- 大数据单机学习环境搭建(5)Hive建表DDL详解
专题:大数据单机学习环境搭建和使用 1. Hive建表简单示例 1.1.Hive建表语句 1.2.表详细信息 1.3.数据展示 2. Hive建表语法详解 3.拓展1:复杂数据分割 4.拓展2:事务表 ...
- mycat 分表子查询_MyCat分库分表策略详解
在我们的项目发展到一定阶段之后,随着数据量的增大,分库分表就变成了一件非常自然的事情.常见的分库分表方式有两种:客户端模式和服务器模式,这两种的典型代表有sharding-jdbc和MyCat.所谓的 ...
- hive建表的标准格式及其建表属性详解1
Hive建表是学习使用hive的第一步,然后才能基于表对hive数据仓库进行操作.学习建表前,首先要知道hive表的构建属性 ,知道哪些属性是固定的,哪些属性是可以定制的等等. 一.标准hql建表语法 ...
- Discuz3.数据库数据表字典详解(完整版)
Discuz3.数据库数据表字典详解(完整版) 转自:https://discuzt.cr180.com/discuzcode-db.html pre_common_admincp_cmenu后台菜单 ...
- Spring Data JPA 从入门到精通~Naming命名策略详解及其实践
Naming 命名策略详解及其实践 用 JPA 离不开 @Entity 实体,我都知道实体里面有字段映射,而字段映射的方法有两种: 显式命名:在映射配置时,设置的数据库表名.列名等,就是进行显式命名, ...
- Oracle表空间_PK是什么意思,Oracle表空间详解
关键字:Oracle表空间详解 一.============ 查询 =================== 1.查询oracle用户的默认表空间和临时表空间 select default_table ...
- Iptables防火墙策略详解
Iptables防火墙策略详解 一.iptables Linux 系统的防火墙--netfilter/iptables IP信息包过滤系统,它实际上由两个组件netfilter 和 iptables组 ...
- MySQL 表分区详解MyiSam引擎和InnoDb 区别(实测)
MySQL 表分区详解MyiSam引擎和InnoDb 区别(实测) 一.什么是表分区 通俗地讲表分区是将一大表,根据条件分割成若干个小表.mysql5.1开始支持数据表分区了. 如:某用户表的记录超过 ...
- js入门·表单详解一(修改表单属性,修改表单元素值)
实在javascript入门·Document对象入门讲解(访问表单,创建新页,获取页标题) 一文中,我们已经把表单的一些基本访问等弄清楚了,下面我们深入的学下表单的属性以及对表单元素的简单操作! 演 ...
最新文章
- java对象转json字符串日期格式_Gson转Json字符串时将日期类型转换成Long型的方法...
- Bugly符号化iOS 崩溃,快速定位crash(上传符号表)
- 要做PPT,一直找不到资源?
- Django缓存和内置信号
- python函数的作用域_python学习第五篇 函数 变量作用域
- 【李宏毅机器学习】Gradient Descent_1 梯度下降(p5、p6、p7 )学习笔记
- python读取文件路径中有中文_转 python 读取中文文件名/中文路径
- android的oomkiller_[Android Memory] Linux下malloc函数和OOM Killer
- 2018福建省考c语言成绩查询,福建省公务员考试录用网成绩查询系统:2019福建省考分数查询入口...
- 图像采样、量化、编码(二十七)
- Spark Client启动原理探索
- 打开gedit_使用 gedit 文本编辑器优化你的 GNOME 体验 | Linux 中国
- 动态RAM(DRAM)和静态RAM(SRAM)的比较
- win10添加网络打印机_win10系统连接网络打印机
- 水纹效果(Water)源程序.
- APMServ 5.2.6虚拟主机配置bug
- 公共自行车租赁点无线管理解决方案
- C++无符号数比较大小
- 五天完成项目-《基于Linux环境下的Cortex A53的手势识别智能家居》-第四天
- mediasoup 学习笔记 【二】Router 房间