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
  • VPC Endpoint
  • Virtual Private Network
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Storage Disaster Recovery Service
  • Scalable File Service
  • Volume Backup Service
Application Services
  • Application Operations Management
  • Application Performance Management
  • API Gateway (APIG)
  • Distributed Message Service
  • Simple Message Notification
Database Services
  • Distributed Cache Service
  • Document Database Service
  • Data Replication Service
  • GaussDB (for MySQL)
  • GeminiDB
  • Relational Database Service
Big Data and Data Analysis
  • Cloud Search Service
  • DataArts Studio
  • Data Ingestion Service
  • Data Lake Insight
  • Data Warehouse Service
  • ModelArts
  • MapReduce Service
  • Optical Character Recognition
Container Services
  • Cloud Container Engine
  • Software Repository for Containers
Applications and Databases
  • Anti DDoS
  • Database Security Service
  • Host Security Service
  • Web Application Firewall
  • Dedicated Web Application Firewall
Identity and Access Management
  • Identity and Access Management Service
Key Management
  • Key Management Service
Compliance
  • Core Services Certifications
Monitoring and Logging
  • Cloud Eye
  • Cloud Trace Service
  • Log Tank Service
Resource Management
  • Cloud Create
  • Resource Management Service
  • Tag Management Service
Other
  • Enterprise Dashboard
  • Price API
  • Price Calculator
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
Other
  • Status Dashboard
  • Portfolio Roadmap
  • Training Certifications
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVPC EndpointVirtual Private NetworkStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceStorage Disaster Recovery ServiceScalable File ServiceVolume Backup ServicePaaSApplications ServicesApplication Operation ManagementApplication Performance ManagementAPI Gateway (APIG)Distributed Message ServiceSimple Message NotificationDatabase ServicesDistributed Cache ServiceDocument Database ServiceData Replication ServiceGaussDB (for MySQL)GeminiDBRelational Database ServiceBig Data and Data AnalysisCloud Search ServiceDataArts StudioData Ingestion ServiceData Lake InsightData Warehouse ServiceModelArtsMapReduce ServiceOptical Character RecognitionContainer ServicesCloud Container EngineSoftware Repository for ContainersSecurityApplications and DatabasesAnti DDoSDatabase Security ServiceHost Security ServiceWeb Application FirewallDedicated Web Application FirewallIdentity and Access ManagementIdentity and Access Management ServiceKey ManagementKey Management ServiceComplianceCore Services CertificationsManagementMonitoring and LoggingCloud EyeCloud Tracking ServiceLog Tank ServiceResource ManagementCloud CreateResource Management ServiceTag Management ServiceOtherEnterprise DashboardPrice APIPrice CalculatorDevelopersAPIsREST APIAPI Usage GuidelinesEndpointsAutomation and DevelopmentSDKsDrivers and ToolsTerraformAnsibleCloud CreateArchitecture CenterBest PracticesBlueprintsOtherStatus DashboardPortfolio RoadmapTraining Certifications

Data Warehouse Service

  • Before You Start
  • Data migration
  • GaussDB(DWS) Development and Design Proposal
  • Defining Database Objects
  • Syntax Compatibility Differences Among Oracle, Teradata, and MySQL
  • GaussDB(DWS) Database Security Management
  • Data Read
  • Collation rules
  • GaussDB(DWS) User-Defined Functions
  • GaussDB(DWS) Stored Procedure
  • Using PostGIS Extension
  • Using JDBC or ODBC for GaussDB(DWS) Secondary Development
  • Hot and Cold Data Management
  • GaussDB(DWS) Resource Monitoring
  • Performance Tuning
    • Overview of Query Performance Optimization
    • Determining the Performance Optimization Scope
    • SQL Execution Plan
    • SQL Optimization Guide
      • Query Execution Process
      • Optimization Process
      • Updating Statistics
      • Reviewing and Modifying a Table Definition
      • Typical SQL Optimization Methods
      • SQL Statement Rewriting Rules
      • Adjusting Key Parameters During SQL Tuning
      • 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
        • Configuration Parameter Hints
        • Hint Errors, Conflicts, and Other Warnings
        • Plan Hint Cases
      • Routinely Maintaining Tables
      • Routinely Recreating an Index
      • Configuring SMP
    • Optimization Cases
    • SQL Execution Troubleshooting
    • Common Performance Parameter Optimization Design
  • 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
  • Performance Tuning
  • SQL Optimization Guide
  • 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-05-05 11:14 UTC - commit: edae5469bf6196c227d02983fb39094683783a6d
Edit pageReport Documentation Bug
Page Contents
  • Sublink Name Hints
    • Function
    • Syntax
    • Precautions
    • Parameter Description
    • Example
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of liabilitys
  • Imprint