pg_auto_failover中的Citus优化

pg_auto_failover中的Citus优化

为何发表这篇文章?

pg_auto_failover将对citus优化的部分功能代码进行了删除,因此您无法使用,需要对代码进行研究后并改写才可以。你可以将citus的集群都当成普通的单机PostgreSQL管理也可以 ...Read more...

pg_auto_failover

pg_auto_failover

pg_auto_failover简介

pg_auto_failover是PostgreSQL的扩展,用于监视和管理postgres集群的故障转移。它针对简单性正确性和业务连续性进行了优化。 ...Read more...

Citus v8.3.0版本编译失败

8.3版本增加的adaptive执行器,自动选择real-time或是task-tracker的执行器,一个非常值得升级的版本
将报错的AllocSetContextCreate 函数更改为AllocSetContextCreateExtended函数

查询Citus某表在Work节点的条数

test=# select n.nodename, n.nodeport, sum(foo.result::int4) from (select * from run_command_on_shards('aa', 'select count(*) from %s')) as foo, pg_dist_placement p, pg_dist_node n where foo.shardid=p.shardid and p.groupid = n.groupid group by n.nodename, n.nodeport;
 nodename  | nodeport | sum  
-----------+----------+------
 localhost |     1601 | 4975
 localhost |     1602 | 5025
(2 rows)

test=# select count(*) from aa;
 count 
-------
 10000
(1 row)