citus 之七 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'; 

参考:
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

你可能感兴趣的:(#,postgresql,shared,citus)