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
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

Using the Query Filter

Updated on 2025-03-03 GMT+08:00

Functions

When using GaussDB(DWS), performance degradation or even complete unavailability of the cluster system can occur due to slow SQL queries. To address this, GaussDB(DWS) offers a query filter function that allows you to intercept problematic statements by creating filtering rules. The filter can block slow SQL queries based on their SQL ID. Additionally, if an exception rule is triggered a certain number of times, the corresponding SQL ID is automatically added to the blacklist for interception. For details, see Exception Rules. The system also supports other interception criteria, such as SQL hash and regular expression matching. Furthermore, interception rules can be customized, allowing them to be applied to specific users or databases.

NOTE:

This function is supported only by clusters of version 9.1.0.200 or later.

Figure 1 Query filter

Creating a Query Filter

  1. Log in to the GaussDB(DWS) console.
  2. Click the name of the target cluster to access the Basic Information page.
  3. Choose Resource Management and click Query Filter.
  4. Click Create to add a query filter.

    Figure 2 Adding a query filter
    Table 1 Parameter description

    Parameter

    Mandatory

    Description

    Database Name

    Yes

    Select a database from the drop-down list.

    Rule Name

    Yes

    Name of the query filter. The value can contain 3 to 63 characters, including uppercase letters, lowercase letters, underscores (_), and dollar signs ($). The value must be unique.

    Match SQL Type

    Yes

    You can select SQL, SQL ID, or QL Hash.

    • SQL: Query the SQL statement that matches the filtering rule.
    • SQL ID: Query the unique_sql_id value that matches the filtering rule.
    • SQL Hash: Query the sql_hash value that matches the filtering rule.

    Statement Type

    No

    You can select All types (default), SELECT, UPDATE, INSERT, DELETE, and MERGE.

    Bind User

    No

    The setting takes effect for a specified user.

    Client Name

    No

    Name of the application that is connected to the database. You can assign a custom application name to each connection, such as gsql.

    Client IP Address

    No

    The setting takes effect for a specified IP address.

    Maximum number of partitions

    No

    Estimated maximum number of partitions on the node to be scanned.

    Maximum number of tables

    No

    Estimated maximum number of tables to be scanned.

    Maximum Number of Rows

    No

    Estimated maximum number of rows on a node to be scanned.

    Task Type

    No

    Type of a task that is actively marked.

    Resource Pool Name

    No

    Name of the resource pool that matches the filtering rule.

    Max. Concurrencies

    No

    Maximum number of concurrent statements corresponding to the filtering rule.

    Alarm

    No

    Whether to enable alarm reporting for filtering rules.

  5. Click OK.

Modifying a Query Filter

  1. Log in to the GaussDB(DWS) console.
  2. Click the name of the target cluster to access the Basic Information page.
  3. Choose Resource Management and click Query Filter.
  4. Click Edit in the Operation column of the target filter to modify it.
  5. Confirm the information and click OK.

    Figure 3 Modifying a query filter

Deleting a Query Filter

  1. Log in to the GaussDB(DWS) console.
  2. Click the name of the target cluster to access the Basic Information page.
  3. Choose Resource Management and click Query Filter.
  4. Click delete in the Operation column of the target filter to delete it.
  5. Click OK.

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