随笔分类 - PostgreSQL
摘要:上一篇解析链接如下:https://www.cnblogs.com/wcwen1990/p/9325968.html1、SQL示例1:SQL> select * from (select * from tmp1 where c >= 1) t1 left join (select * from tmp2 where b 1 and t1.e >= 2 where t1.b =CASE WH...
阅读全文
摘要:1、测试数据如下:SQL> select * from t1; a | b | c ---+----+--- 1 | 10 | 1 2 | 20 | 2 3 | 30 | 3 4 | 40 | 4 5 | 50 | 5 6 | 60 | 6(6 rows)SQL> select * from t2; a | b | d ---+----+--- 1 | 10 | 1 2 |...
阅读全文
摘要:一、规划1、服务器:192.168.0.191 gpdb01 # master 192.168.0.192 gpdb02 # primary segment 、 mirror segment192.168.0.193 gpdb03 # primary segment 、 mirror segment192.168.0.194 gpdb04 ...
阅读全文
摘要:一、百万级数据库优化方案1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null最好不要给数据库留NULL,尽可能的使用 NOT NULL填充数据库.备注、描述、评论之...
阅读全文
摘要:This document describes the installation of PostgreSQL using the source code distribution. (If you are installing a pre-packaged distribution, such as an RPM or Debian package, ignore this do...
阅读全文
摘要:最近安装了一套clourdera manager,其中hive元数据保存在postgresql中,因为今天想看一下hive的元数据信息,就登录了psql,连接到hive元数据库,发起select操作,报错如下: 这个错误因为postgresql不像oracle那么智能,postgresql区分大小写
阅读全文
摘要:yum -y install gcc make readline zlib readline-devel zlib-develtar -jxvf postgresql-9.5.2.tar.bz2cd postgresql-9.5.2groupadd postgresuseradd -g postgr
阅读全文
摘要:安装过程: 1、configuration --prefix=PREFIX install all files under the directory PREFIX instead of usr/local/psql --with-pgport=NUMBER set NUMBER as the de
阅读全文