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

Obtaining Diagnosis Results

Updated on 2025-01-17 GMT+08:00

Function

This API is used to obtain SQL diagnosis results.

URI

GET /v3/{project_id}/connections/{connection_id}/tuning/{message_id}/show-tuning-result

Table 1 URI parameters

Parameter

Mandatory

Type

Description

message_id

Yes

String

Diagnosis information ID.

project_id

Yes

String

Project ID.

To obtain this value, see Obtaining a Project ID.

connection_id

Yes

String

Connection ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Language

No

String

Language.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

tune_result

AdviceResult object

Diagnosis result.

Table 4 AdviceResult

Parameter

Type

Description

message_id

String

Diagnosis information ID.

status_code

String

Status code.

error_code

String

Error code.

error_message

String

Error message.

index_advice

Array of IndexAdviceInfo objects

Suggestions on indexes.

tuning_advice

Array of strings

Diagnosis suggestions.

formatted_sql

String

Formatted SQL statement.

original_sql

String

Original SQL statement.

explain

Array of Explain objects

Execution plan.

tb_pos_infos

Array of TbPosInfo objects

Table location information.

feedback_infos

FeedbackInfo object

Feedback information.

Table 5 IndexAdviceInfo

Parameter

Type

Description

schema_name

String

Schema name.

table_name

String

Table name.

index_name

String

Index name.

columns

Array of strings

Column.

unique

Boolean

Unique or not.

track_id

String

Tracking ID.

quality

Object

Quality.

ddl_add_index

String

Index to be added for DDL.

Table 6 Explain

Parameter

Type

Description

id

Integer

Type of the SELECT clause.

select_type

String

Type of the SELECT clause.

table

String

Table JOIN sequence selected by the SQL optimizer.

type

String

Access type of the row in the table,

ordered from the best type to the worst (null>system>const>eq_ref>ref>range>index>all).

possible_keys

String

Index that helps find the required row.

key

String

Index actually used by SQL Optimizer to minimize query costs.

key_len

String

Length (bytes) of the index in the key column.

ref

String

Column or constant for querying data using the index in the key column.

rows

Long

Length (bytes) of the index in the key column.

filtered

Double

Percentage of remaining values after data is scanned at the engine layer and filtered based on the additional WHERE condition.

extra

String

Additional information about SQL parsing.

  • If using index is displayed, the SQL statement uses the overwrite index and performs well.
  • If using filesort, using temporary, or using where is displayed, the query needs to be optimized.
Table 7 TbPosInfo

Parameter

Type

Description

origin_name

String

Original name.

name

String

Name.

start

Integer

Start.

end

Integer

End.

Table 8 FeedbackInfo

Parameter

Type

Description

id

String

ID.

project_id

String

Project ID.

message_id

String

Unique message ID.

feedback_grade

String

Feedback level.

feedback_content

String

Feedback content.

gmt_created

Long

Creation time.

gmt_modified

Long

Modification time.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum length: 8 characters

Maximum length: 36 characters

error_msg

String

Error message.

Minimum length: 2 characters

Maximum length: 512 characters

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum length: 8

Maximum length: 36

error_msg

String

Error message.

Minimum length: 2 characters

Maximum length: 512 characters

Example Requests

None

Example Response

{
	"tune_result": {
		"message_id": "6507f5070cf2476b18473d9b",
		"status_code": "0000",
		"error_message": "Success",
		"formatted_sql": "SELECT *\nFROM test_tb",
		"original_sql": "select * from test_tb",
		"tuning_advice": [
			"The outermost SELECT statement does not have a WHERE condition specified, which could result in more rows being returned than anticipated."
		],
		"explain": [{
			"id": 1,
			"select_type": "SIMPLE",
			"type": "ALL",
			"rows": 100512,
			"filtered": 100
		}],
		"tb_pos_infos": [{
			"origin_name": "test_tb",
			"name": "test_tb",
			"start": 14,
			"end": 21
		}],
		"feedback_infos": {}
	}
}

Status Code

Status Code

Description

200

Success.

400

Bad request.

500

Internal server error.

Error Code

See Error Codes.

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