section> Computing
  • Auto Scaling
  • Bare Metal Server
  • Dedicated Host
  • Elastic Cloud Server
  • FunctionGraph
  • Image Management Service
Network
  • Direct Connect
  • Domain Name Service
  • Elastic IP
  • Elastic Load Balancing
  • Enterprise Router
  • NAT Gateway
  • Private Link Access Service
  • Secure Mail Gateway
  • Virtual Private Cloud
  • Virtual Private Network
  • VPC Endpoint
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Scalable File Service
  • Storage Disaster Recovery Service
  • Volume Backup Service
Application
  • API Gateway (APIG)
  • Application Operations Management
  • Application Performance Management
  • Distributed Message Service (for Kafka)
  • Simple Message Notification
Data Analysis
  • Cloud Search Service
  • Data Lake Insight
  • Data Warehouse Service
  • DataArts Studio
  • MapReduce Service
  • ModelArts
  • Optical Character Recognition
Container
  • Application Service Mesh
  • Cloud Container Engine
  • Cloud Container Instance
  • Software Repository for Containers
Databases
  • Data Replication Service
  • Distributed Cache Service
  • Distributed Database Middleware
  • Document Database Service
  • GeminiDB
  • Relational Database Service
  • TaurusDB
Management & Deployment
  • Cloud Create
  • Cloud Eye
  • Cloud Trace Service
  • Config
  • Log Tank Service
  • Resource Formation Service
  • Tag Management Service
Security Services
  • Anti-DDoS
  • Cloud Firewall
  • Database Security Service
  • Dedicated Web Application Firewall
  • Host Security Service
  • Identity and Access Management
  • Key Management Service
  • Web Application Firewall
Other
  • Enterprise Dashboard
  • Marketplace
  • Price Calculator
  • Status Dashboard
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVirtual Private NetworkVPC EndpointStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceScalable File ServiceStorage Disaster Recovery ServiceVolume Backup ServicePaaSApplicationAPI Gateway (APIG)Application Operations ManagementApplication Performance ManagementDistributed Message Service (for Kafka)Simple Message NotificationData AnalysisCloud Search ServiceData Lake InsightData Warehouse ServiceDataArts StudioMapReduce ServiceModelArtsOptical Character RecognitionContainerApplication Service MeshCloud Container EngineCloud Container InstanceSoftware Repository for ContainersDatabasesData Replication ServiceDistributed Cache ServiceDistributed Database MiddlewareDocument Database ServiceGeminiDBRelational Database ServiceTaurusDBManagementManagement & DeploymentCloud CreateCloud EyeCloud Trace ServiceConfigLog Tank ServiceResource Formation ServiceTag Management ServiceSecuritySecurity ServicesAnti-DDoSCloud FirewallDatabase Security ServiceDedicated Web Application FirewallHost Security ServiceIdentity and Access ManagementKey Management ServiceWeb Application FirewallOtherOtherEnterprise DashboardMarketplacePrice CalculatorStatus Dashboard

Data Warehouse Service

  • Before You Start
  • Migrating GaussDB(DWS) Data
  • GaussDB(DWS) Development Design Proposal
  • Creating and Managing GaussDB(DWS) Database Objects
  • Syntax Compatibility Differences Among Oracle, Teradata, and MySQL
  • GaussDB(DWS) Database Security Management
  • GaussDB(DWS) Data Query
  • GaussDB(DWS) Sorting Rules
  • GaussDB(DWS) User-Defined Functions
  • GaussDB(DWS) Stored Procedure
  • Using PostGIS Extension
  • Using JDBC or ODBC for GaussDB(DWS) Secondary Development
  • GaussDB(DWS) Hot and Cold Data Management
  • GaussDB(DWS) Resource Monitoring
  • GaussDB(DWS) Performance Tuning
    • Overview
    • Performance Diagnosis
    • System Optimization
    • SQL Tuning
      • SQL Query Execution Process
      • SQL Execution Plan
      • Execution Plan Operator
      • SQL Tuning Process
      • Updating Statistics
      • Reviewing and Modifying a Table Definition
      • Advanced SQL Tuning
      • Configuring Optimizer Parameters
      • Hint-based Tuning
        • Plan Hint Optimization
        • Join Order Hints
        • Join Operation Hints
        • Rows Hints
        • Stream Operation Hints
        • Scan Operation Hints
        • Sublink Name Hints
        • Skew Hints
        • Hint That Disables Subquery Pull-up
        • Dictionary Code Hint
        • Configuration Parameter Hints
        • Hint Errors, Conflicts, and Other Warnings
        • Plan Hint Cases
      • Routinely Maintaining Tables
      • Routinely Recreating an Index
      • Automatic Retry upon SQL Statement Execution Errors
      • Query Band Load Identification
    • SQL Tuning Examples
  • GaussDB(DWS) System Catalogs and Views
  • GUC Parameters of the GaussDB(DWS) Database
  • GaussDB(DWS) Developer Terms
  • Hybrid Data Warehouse
  • SQL Syntax Reference
  • Change History
  • Developer Guide
  • GaussDB(DWS) Performance Tuning
  • SQL Tuning
  • Hint-based Tuning
  • Sublink Name Hints

Sublink Name Hints¶

Function¶

These hints specify the name of a sublink block.

Syntax¶

blockname ([@block_name] table)

Precautions¶

  • This block name hint is used by an outer query only when a sublink is pulled up. Currently, only the Agg equivalent join, IN, and EXISTS sublinks can be pulled up. This hint is usually used together with the hints described in the previous sections.

  • The subquery after the FROM keyword is hinted by using the subquery alias. In this case, block_name hint becomes invalid.

  • If a sublink contains multiple tables, the tables will be joined with the outer-query tables in a random sequence after the sublink is pulled up. In this case, blockname also becomes invalid.

Parameter Description¶

  • block_name indicates the block name of the statement block. For details, see block_name.

  • table indicates the name you have specified for a sublink block.

    Note

    • The syntax format of the table is as follows:

      [schema.]table[@block_name]

      The table name can contain the schema name or block name before the subquery statement block is promoted. If the subquery statement block is optimized and rewritten by the optimizer, the value of block_name is different from that of block_name in leading.

    • If a table has an alias, the alias is preferentially used to represent the table.

Example¶

explain select /*+nestloop(store_sales tt) */ * from store_sales where ss_item_sk in (select /*+blockname(tt)*/ i_item_sk from item group by 1);

tt indicates the sublink block name. After being pulled up, the sublink is joined with the outer-query table store_sales by using nestloop. The optimized plan is as follows:

image1

  • Prev
  • Next
last updated: 2025-06-16 14:19 UTC - commit: 82f4678e74eea407ac48b56afc78e708dfc73d10
Edit pageReport Documentation Bug
Page Contents
  • Sublink Name Hints
    • Function
    • Syntax
    • Precautions
    • Parameter Description
    • Example
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of Liabilities
  • Imprint