Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ GaussDB/ Developer Guide(Distributed_8.x)/ Configuring GUC Parameters/ GUC Parameters/ Session-level Transaction Pushdown and Related Parameters

Session-level Transaction Pushdown and Related Parameters

Updated on 2024-06-03 GMT+08:00

session_type

Parameter description: Specifies the type of the current session. The value is case insensitive. An execution plan is generated based on the actual value.

Value type: enumerated type

Unit: none

Value range:

  • single_node: single-node session. Read and write operations can be pushed down. Nodes to be pushed down are determined and an execution plan is generated based on the GUC parameter exec_target_node.
  • global_read_only: cross-node read-only session. A distributed plan is generated normally, but distributed write operations are forbidden. The GUC parameter exec_target_node does not take effect.
  • normal: default session, which is the same as the original behavior. The plan is executed based on the original logic of the database.
NOTICE:

When data is inserted in single-node session mode (session_type is set to single_node), correct data distribution is ensured by the application layer. If an incorrect node is specified, data may be inconsistent.

Default value: normal

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 2. Note that this parameter cannot be set globally using gs_guc.

exec_target_node

Parameter description: Specifies the name of the DN where DML statements and some DDL statements (TRUNCATE and ALTER TABLE...TRUNCATE PARTITION...) of the current session are executed. The name is case sensitive. If the DN name is invalid, an error is reported during the setting.

NOTICE:

This parameter is valid only when the GUC parameter session_type is set to single_node.

Parameter type: string

Unit: none

Value range: names of all DNs in the current cluster.

Default value: NULL

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 2. Note that this parameter cannot be set globally using gs_guc.

NOTE:

The single-node session mode has the following restrictions:

  • The router function does not take effect in this scenario.
  • The DN specified by node_name hint does not take effect and is delivered by exec_target_node.
  • Statements involving row-level security are not supported.
  • Reading on the distributed standby node is not supported.
  • Advanced package statements are not supported.
  • GPC is not supported. When the enable_global_plancache parameter is enabled, if PBE is executed, an error is reported.
  • In single-node session mode, when the PBE statement is used, the plan type is directly set to GPlan. If the single-node session mode is specified after a plan is generated, the original plan type remains unchanged.

Examples

gaussdb=# set log_min_messages = debug2;
gaussdb=# set logging_module = 'on(opt_choice)';
gaussdb=# create table t1(a int ,b int);
gaussdb=# prepare x(int) as select * from t1;
gaussdb=# explain execute x(10);
NOTICE:  [Choosing C/G/A Plan]: GPlan, reason: Using pbe optimization.
NOTICE:  [Choosing C/G/A Plan]: CPlan, reason: First 5 times using CPlan.
                    QUERY PLAN                    
--------------------------------------------------
 Data Node Scan  (cost=0.00..0.00 rows=0 width=0)
   Node/s: All datanodes
(2 rows)
gaussdb=# DEALLOCATE x;
gaussdb=# prepare x(int) as select * from t1;
gaussdb=# set session_type=single_node;
gaussdb=# set exec_target_node=datanode1;
gaussdb=# explain execute x(10);
NOTICE:  [Choosing C/G/A Plan]: GPlan, reason: Using pbe optimization.
NOTICE:  [Choosing C/G/A Plan]: GPlan, reason: Using pbe optimization.
                    QUERY PLAN                    
--------------------------------------------------
 Data Node Scan  (cost=0.00..0.00 rows=0 width=0)
   Node/s: datanode1
(2 rows)
gaussdb=# DEALLOCATE x;
gaussdb=# drop table t1;

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback