citus 之七 citus.enable_repartition_joins、citus.task_executor_type

os: ubuntu 16.04
db: postgresql 9.6.8
citus: 8.0

citus 版本

root@coor1:~# dpkg -l |grep -i citus
ii  postgresql-9.6-citus                  8.0.0.PGDG-1.pgdg16.04+1                   amd64        sharding and distributed joins for PostgreSQL

peiybdb=# \timing
peiybdb=# select * from pg_available_extensions where name like '%citus%';
 name  | default_version | installed_version |          comment           
-------+-----------------+-------------------+----------------------------
 citus | 8.0-8           | 8.0-8             | Citus distributed database
(1 row)

Time: 1.438 ms

citus 描述

peiybdb=# \x
Expanded display is on.
peiybdb=# select * from pg_settings where name = 'citus.task_executor_type';
-[ RECORD 1 ]---+-------------------------------------------------------------------------------------------------
name            | citus.task_executor_type
setting         | real-time
unit            | 
category        | Customized Options
short_desc      | Sets the executor type to be used for distributed queries.
extra_desc      | The master node chooses between two different executor types when executing a distributed query.
The real-time executor is optimal for simple key-value lookup queries and queries that involve aggregations and/or co-located joins on multiple shards. 
The task-tracker executor is optimal for long-running, complex queries that touch thousands of shards and/or that involve table repartitioning.
context         | user
vartype         | enum
source          | session
min_val         | 
max_val         | 
enumvals        | {real-time,task-tracker}
boot_val        | real-time
reset_val       | real-time
sourcefile      | 
sourceline      | 
pending_restart | f

Time: 0.754 ms

extra_desc 列还是描述的挺清楚的.可以简单理解为 一个是为 oltp 环境准备的,一个是为 oltp 环境准备的.

citus.task_executor_type (enum)
Citus has two executor types for running distributed SELECT queries. The desired executor can be selected by setting this configuration parameter. 
The accepted values for this parameter are:

real-time: 
  The real-time executor is the default executor and is optimal when you require fast responses to queries that involve aggregations and co-located joins spanning across multiple shards.

task-tracker: 
  The task-tracker executor is well suited for long running, complex queries which require shuffling of data across worker nodes and efficient resource management.

This parameter can be set at run-time and is effective on the coordinator. 
For more details about the executors, you can visit the Distributed Query Executor section of our documentation.

peiybdb=# set citus.enable_repartition_joins = on;

peiybdb=# set citus.task_executor_type='task-tracker';
peiybdb=# set citus.task_executor_type='real-time'; 

后面版本 real-time 升级成增强版 adaptive

peiybdb=# set citus.task_executor_type='adaptive'; 

citusdb=# \x
Expanded display is on.
citusdb=# select * from pg_settings where name like 'citus.task_executor_type%';
-[ RECORD 1 ]---+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name            | citus.task_executor_type
setting         | adaptive
unit            | 
category        | Customized Options
short_desc      | Sets the executor type to be used for distributed queries.
extra_desc      | The master node chooses between two different executor types when executing a distributed query.The adaptive executor is optimal for simple key-value lookup queries and queries that involve aggregations and/or co-located joins on multiple shards. The task-tracker executor is optimal for long-running, complex queries that touch thousands of shards and/or that involve table repartitioning.
context         | user
vartype         | enum
source          | default
min_val         | 
max_val         | 
enumvals        | {adaptive,real-time,task-tracker}
boot_val        | adaptive
reset_val       | adaptive
sourcefile      | 
sourceline      | 
pending_restart | f

参考:
https://docs.citusdata.com/en/stable/develop/api_guc.html?highlight=enable_repartition_joins
https://docs.citusdata.com/en/stable/develop/api_guc.html?highlight=task_executor_type

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据库人生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值