GP数据库
GP数据库重计算的,对大数据集进行统计分析的OLAP类型,GP数据库的数据库类型为分布式数据库,GP数据库支持海量数据存储,支持列的扩展,查询速度快,但是查询操作较复杂。
- 查看表空间:select * from pg_tablespace;
- 查看表结构:select show_table(’schema.表名‘);
- 查看表大小:select pg_size_pretty(pg_relation_size(‘schema.表名’));
- 添加字段:alter table schema.表名 add column 字段名 字段类型;
- 修改字段: alter table schema.表名 alter column 字段名 type character 字段类型;
或者alter table schema.表名 alter column 字段名 字段类型; - 删除字段:alter table schema.表名 drop column 字段名;
- 查某用户进程:select * from pg_stat_activity where usename = ‘用户名’ and current_query <> ‘’ order by query_start asc
- 杀进程:select terminate_by_normal_user(‘procpid’,‘gpest’);
- 修改分布键:alter table 用户.表名 set distributed by(分布键);