### GetQueryOptimizeSolution Successful JSON Response Example Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizesolution This JSON example illustrates a successful response from the `GetQueryOptimizeSolution` API, showing the structure of the returned data, including the `Code`, `Message`, `Data` object with `List` of governance suggestions, `RequestId`, and `Success` status. ```JSON { "Code": 200, "Message": "Successful", "Data": { "Total": 1, "PageNo": 0, "PageSize": 0, "Extra": "None", "List": [ { "Level": "INFO", "RuleId": "LARGE_ROWS_EXAMINED", "Solution": "LARGE_ROWS_EXAMINED_SOLUTION", "SolutionExt": "None" } ] }, "RequestId": "30FF4E40-17F3-5A51-AB23-43F30D9B****", "Success": true } ``` -------------------------------- ### Example JSON Response for DescribeTopHotKeys Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-describetophotkeys A sample successful JSON response demonstrating the data structure returned by the `DescribeTopHotKeys` API call. This example shows a single hot key entry. ```JSON { "Message": "Successful", "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Data": { "HotKey": [ { "Db": 0, "Key": "abc:def:eng", "Hot": "5500~6000", "KeyType": "zset", "Lfu": 253, "NodeId": "r-x****-db-0" } ] }, "Code": 200, "Success": true } ``` -------------------------------- ### Aliyun DAS API Successful Response Example Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-seteventsubscription An example of a successful JSON response from the Aliyun DAS API, illustrating the structure and typical values for various fields returned. ```JSON { "RequestId": "097F0C56-B252-515A-B602-FC56EF93EF8A", "Message": "Successful", "Data": { "userId": "1088760496****", "instanceId": "rm-2ze8g2am97624****", "eventContext": "AllContext", "lang": "zh_CN", "active": 1, "minInterval": 60, "contactName": "默认联系人", "contactGroupName": "默认联系组", "channelType": "hdm_alarm_sms,dingtalk", "level": "Optimization" }, "Code": 200, "Success": true } ``` -------------------------------- ### AddHDMInstance Successful Response Example Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-addhdminstance An example of a successful JSON response returned by the AddHDMInstance API. ```JSON { "Message": "Successful", "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Synchro": "None", "Data": { "VpcId": "vpc-m5e666n89m2bx8jar****", "Token": "tokenID", "Ip": "rm-de21209****.mysql.rds.aliyuncs.com", "CallerUid": "31063db679****", "InstanceId": "rm-2ze1jdv45i7l6****", "Port": 3306, "OwnerId": 325352345, "Uuid": "hdm_3063db6792965c080a4bcb6e6304****", "Error": "InvalidRequestURL", "Code": 200, "Role": "master", "TenantId": "L0EPfLS****=SCE00000*****" }, "Code": 200, "Success": true } ``` -------------------------------- ### Example JSON Response for GetQueryOptimizeExecErrorSample Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizeexecerrorsample A sample JSON response demonstrating the successful output of the GetQueryOptimizeExecErrorSample API call, including data structure for failed query execution samples. ```JSON { "Code": 200, "Message": "Successful", "Data": { "Total": 2, "PageNo": 0, "PageSize": 0, "Extra": "None", "List": [ { "OrigHost": "100.104.XX.XX", "User": "test01", "Dbname": "testdb01", "SqlId": "2e8147b5ca2dfc640dfd5e43d96a****", "SqlText": "select * from test1", "ErrorCode": 1146, "Timestamp": 1643020306739 } ] }, "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Success": true } ``` -------------------------------- ### Successful JSON API Response Example for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-describeslowlogstatistic This snippet provides a comprehensive example of a successful JSON response from an Aliyun DAS API call. It details various fields related to query logs, performance metrics, instance information, and other operational data, demonstrating the typical structure of a successful API return. ```JSON { "Code": 200, "Message": "Successful", "RequestId": "52D540CF-C517-1F57-BB42-9035F96******", "Success": true, "Data": { "RequestKey": 123456789, "ResultId": "async__665ee69612f1627c7fd9f3c85075****", "State": "SUCCESS", "IsFinish": true, "Data": { "DbInstanceName": 0, "NodeId": "pi-wz99g5rn7w1x8h0sf", "ItemsNumbers": 10, "StartTime": "2024-10-08T02:01:00Z", "EndTime": "2024-08-08T02:15:00Z", "DbInstanceId": 0, "TotalRecords": 13, "PageNumbers": 1, "MaxRecordsPerPage": 10, "Logs": [ { "Count": 12, "MaxLockTime": 0, "MaxQueryTime": 0, "MaxRowsExamined": 318613, "MaxRowsSent": 256, "AvgQueryTime": 0, "QueryTimeRate": 0.1018, "CountRate": 0.2034, "AvgRowsExamined": 53421, "OriginAlias": "order-1", "User": "user-1", "SqlTag": { "SqlId": "a3931d8c3a9315dd5ed016d71cf*****", "Tags": "DAS_IN_PLAN", "Comments": "dba 归档" }, "Trend": [ { "Timestamp": 1723775362, "Value": "tf-testacc-oos-parameter" } ], "Database": "work-wechat-api", "Histogram": { "Total": 7, "Count": [ 100 ], "Ts": [ 1715220818 ], "TsEnd": [ 0 ], "Item": [ { "NodeId": "r-bp1s1m8hwzrm77kfvz-db-0", "Count": [ 100 ] } ], "Rt": [ 1854 ], "AvgRt": [ 3709 ], "MaxRt": [ 2516 ], "LockTime": [ 300 ], "AvgLockTime": [ 15 ], "MaxLockTime": [ 1051 ], "RowsExamined": [ 641057 ], "AvgRowsExamined": [ 222189 ], "MaxRowsExamined": [ 878511 ], "RowsSent": [ 4 ], "AvgRowsSent": [ 2 ], "MaxRowsSent": [ 256 ] }, "SqlId": "2dca88762ec6b3812504ab8a4b******", "Scheme": "HTTP", "SubInstanceId": "r-8vba51c588ba3a94", "DbInstanceName": 0, "InsName": "rm-uf6zix1z2jh1y6fe5", "AccountName": "edu_admin", "HostAddress": "172.23.142.178", "QueryStartTime": "2024-12-25T03:00:00Z", "SQLText": "SELECT 'Hello, World!' FROM DUAL", "Psql": "SELECT b?.id,b?.t?,b?.id,b?.t? FROM testtb? b? JOIN testtb? b? ON b?.id=b?.id WHERE b?.t? LIKE ? ORDER BY b?.id DESC", "DBName": "member_score", "QueryTime": 272.444, "ReturnItemNumbers": "暂无", "DocsExamined": 1, "KeysExamined": 20000, "TableName": "users\\nifconfig\\n", "LockTime": 0, "RowsExamined": 2444081, "RowsSent": 772, "ThreadId": 1, "Timestamp": 1708568930, "AvgLockTime": 0, "AvgRowsSent": 2, "LockTimeSeconds": 0, "QueryTimeSeconds": 25.472, "AvgLockTimeSeconds": 0, "MaxLockTimeSeconds": 0, "MaxQueryTimeSeconds": 14.402, "AvgQueryTimeSeconds": 6.211, "SqlType": "LOGIN", "QueryId": "sq-1pzcdMwRb", "NodeType": "DLNode", "HostInsId": "mongo-abc123456", "InsRole": "__system", "OpType": "Insert", "Namespace": "database.collection", "AvgKeysExamined": 20000, "AvgDocExamined": 10000, "AvgReturnNum": 1, "MaxKeysExamined": 2000000, "MaxDocExamined": 1000000, "MaxReturnNum": 1, "ReturnNum": 1, "DocExamined": 2000000, "Command": "SELECT b?.id,b?.t?,b?.id,b?.t? FROM testtb? b? JOIN testtb? b? ON b?.id=b?.id WHERE b?.t? LIKE ? ORDER BY b?.t? DESC", "IOWrites": 1000, "MaxIOWrites": 1000, "LastRowsCountAffected": 1000, "MaxLastRowsCountAffected": 1000, "LogicalIOReads": 1000, "MaxLogicalIOReads": 1000, "PhysicalIOReads": 1000, "MaxPhysicalIOReads": 1000, "RowsCountAffected": 1000, "MaxRowsCountAffected": 1000, "CPUTime": 0, "AvgCPUTime": 0, "MaxCPUTime": 0, "AvgIOWrites": 1000, "AvgLastRowsCountAffected": 1000, "AvgLogicalIOReads": 1000, "AvgPhysicalIOReads": 1000, "AvgRowsCountAffected": 1000, "AvgCPUTimeSeconds": 0, "MaxCPUTimeSeconds": 0 } } } ``` -------------------------------- ### Aliyun DAS API Successful Response Example Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-updateautothrottlerulesasync An example of a successful JSON response from the Aliyun DAS API, demonstrating the structure and typical values for various fields, including nested objects and arrays for instance configuration results. ```JSON { "Code": 200, "Message": "Successful", "Data": { "Fail": false, "ConfigResponse": { "TotalInstanceCount": 2, "ConfigSuccessInstanceCount": 1, "ConfigFailInstanceCount": 1, "ConfigSuccessInstanceList": [ { "ConfigSuccess": true, "InstanceId": "rm-2ze8g2am97624****" } ], "ConfigFailInstanceList": [ { "ConfigSuccess": false, "InstanceId": "rm-2ze9xrhze0709****", "ErrorMessage": "instance das autonomy service is off or can not find instance" } ] }, "ResultId": "async__665ee69612f1627c7fd9f3c85075****", "IsFinish": true, "State": "SUCCESS", "Complete": true, "Timestamp": 1645668213000 }, "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Success": true } ``` -------------------------------- ### Example JSON Response for GetRunningSqlConcurrencyControlRules Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getrunningsqlconcurrencycontrolrules A sample JSON response demonstrating the successful retrieval of running SQL concurrency control rules, including details about the rules such as ItemId, SqlType, InstanceId, and Status. ```JSON { "Code": 200, "Message": "Successful", "Data": { "Total": 2, "List": { "runningRules": [ { "ItemId": 16, "SqlType": "SELECT", "InstanceId": "rm-2ze1jdv45i7l6****", "SqlKeywords": "call~open~api~test~4~from~POP", "StartTime": 1608888296000, "KeywordsHash": "b0b8aceeb43baea87b219c81767b****", "ConcurrencyControlTime": 600, "UserId": "testxxx", "MaxConcurrency": 2, "Status": "Open" } ] } }, "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Success": true } ``` -------------------------------- ### Get Partitions Heatmap API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves a heatmap visualization of database partitions. This helps in understanding data distribution and access patterns across partitions. ```APIDOC API Name: GetPartitionsHeatmap Permission: hdm:GetPartitionsHeatmap Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getpartitionsheatmap ``` -------------------------------- ### API Response Return Parameters Reference Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getpfssqlsummaries Defines the structure and properties of the API's return parameters, including nested objects and arrays, their data types, descriptions, and example values. ```APIDOC ListResult (object): Message (string): Request return message. When the request is successful, this parameter returns Successful. If the request fails, an exception message (such as an error code) is returned. Example: Successful RequestId (string): Request ID. Example: 54F3DBAE-9420-511A-9C29-265E8C04**** Data (object): Returned data. Total (long): Total data volume. Example: 264 List (array): Detailed information list. Item (object): Returned information list. UserId (string): User ID. Example: 196278346919**** Psql (string): SQL template. Example: select ? InstanceId (string): Instance ID. Example: rm-2ze8g2am97624**** NodeId (string): Node ID. For RDS MySQL cluster series or PolarDB MySQL Edition database instances, this parameter is returned. Example: r-x****-db-0 SqlType (string): Type of SQL. Values: SELECT, UPDATE, DELETE. Example: SELECT LogicId (long): Logical library ID. Example: 58275984 SqlId (string): SQL template ID. Example: 2e8147b5ca2dfc640dfd5e43d96a**** Timestamp (long): Data date, in Unix timestamp format, in milliseconds. Example: 1643040000000 RtRate (double): Time consumption ratio. Example: 0.1384 CountRate (double): Execution count ratio. Example: 0.0586 FullScan (boolean): Whether it is a full table scan. Values: true (yes), false (no). Example: true Count (long): Total execution count. Example: 100000 ErrCount (long): Error count. Example: 0 WarnCount (long): Warning count. Example: 0 TotalLatency (double): Total execution time, in milliseconds. Example: 60913.256 MaxLatency (double): Maximum execution time, in milliseconds. Example: 36.233 AvgLatency (double): Average SQL execution time, in milliseconds. Example: 0.1717 RowsSent (long): Number of rows returned. Example: 0 RowsSendAvg (double): Average number of rows sent. Example: 0 RowsExamined (long): Total scanned rows. Example: 100 RowsExaminedAvg (double): Average scanned rows. Example: 0 RowsAffected (long): Affected rows. Example: 0 RowsAffectedAvg (double): Average affected rows. Example: 0 TmpTables (long): Number of temporary tables. Example: 0 TmpDiskTables (long): Number of temporary disk tables. Example: 0 RowsSorted (long): Number of sorted rows. Example: 0 SortMergePasses (long): Number of merges that the sort algorithm must perform. Example: 0 PhysicalReads (long): Number of physical nodes. Example: 0 PhysicalAsyncReads (long): Number of physical asynchronous nodes. Example: 0 SemisyncDelayTime (double): Semi-synchronous delay time, in milliseconds. Example: 0.12 RowsSentAvg (double): Average number of rows returned by SQL statements. Example: 0.52 LogicReads (long): Number of logical nodes. Example: 0 RedoWrites (long): Number of redo nodes. Example: 0 DataWriteTime (double): Data write time, in milliseconds. Example: 0 DataWrites (integer): Number of writable data nodes. Example: 0 DataReadTime (double): Readable data time, in milliseconds. Example: 0 DataReads (integer): Number of readable data nodes. Example: 0 RwlockOsWaits (integer): Whether read-write splitting is enabled. Values: 0 (not enabled), 1 (enabled). Example: 0 RwlockSpinRounds (integer): Read-write splitting parameter. Example: 0 RwlockSpinWaits (integer): Whether multi-index scanning is enabled. Values: 0 (not enabled), 1 (enabled). Example: 0 MutexWaits (integer): Mutex wait count. Example: 1 MutexSpins (integer): Mutex spin count. Example: 1 TransactionLockTime (double): Storage transaction lock time, in milliseconds. Example: 0 ServerLockTime (double): Server lock time, in milliseconds. Example: 0 CpuTime (double): CPU runtime, in milliseconds. Example: 0 ElapsedTime (double): Actual runtime, in milliseconds. Example: 0 Id (long): Primary key ID. Example: 26186357 SelectScanAvg (double): Average scan count. Example: 0 SelectRangeAvg (double): Average selection range. Example: 0 SelectFullJoinAvg (double): Average number of joins that perform table scans without using an index. Note: If this parameter is not 0, the table index should be carefully checked. Example: 0 SelectFullRangeJoinAvg (double): Average range join count. Example: 0 SortScanAvg (double): Average sort scan count. Example: 0 SortRowsAvg (double): Average sorted rows. Example: 0 TmpTablesAvg (double): Average temporary tables. Example: 0 TmpDiskTablesAvg (double): Average temporary disk tables. Example: 0 FirstTime (long): First execution time, in Unix timestamp format, in milliseconds. Example: 1659308149000 LastTime (long): Last modification time, in Unix timestamp format, in milliseconds. Example: 1661306520000 LockLatencyAvg (double): Average lock wait time, in milliseconds. Example: 0 TimerWaitAvg (double): Reserved parameter. Example: None SortRangeAvg (double): Average number of range sorts used. Example: 0 CpuRate (double): Ratio of CPU execution time to total SQL execution time. Example: 0 Db (string): Database name. Example: testDB Tables (array): Database table names. Item (string): Database table name. Example: test_table PageNo (long): Page number. Example: 1 PageSize (long): Maximum number of records per page. Example: 10 Extra (any): Reserved parameter. Example: None Code (long): Return status code. Example: 200 Success (boolean): Whether the request was executed successfully: true (successful), false (failed). Example: true ``` -------------------------------- ### Example Successful Response for GetSqlConcurrencyControlRulesHistory Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getsqlconcurrencycontrolruleshistory A JSON example demonstrating a successful response from the GetSqlConcurrencyControlRulesHistory API. It illustrates the typical data structure, including total records, a list of historical rules with their properties like ItemId, SqlType, InstanceId, SqlKeywords, and Status. ```JSON { "Code": 200, "Message": "Successful", "Data": { "Total": 4, "List": { "rules": [ { "ItemId": 16, "SqlType": "SELECT", "InstanceId": "rm-2ze1jdv45i7l6****", "SqlKeywords": "call~open~api~test~4~from~POP", "StartTime": 1608888296000, "KeywordsHash": "b0b8aceeb43baea87b219c81767b****", "ConcurrencyControlTime": 600, "UserId": "testxxx", "MaxConcurrency": 2, "Status": "Open" } ] } }, "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Success": true } ``` -------------------------------- ### Get PFS SQL Sample API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Fetches sample SQL statements from the performance schema (PFS). This helps in understanding the types of queries being executed and their characteristics. ```APIDOC API Name: GetPfsSqlSample Permission: hdm:GetPfsSqlSample Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getpfssqlsample ``` -------------------------------- ### Get Instance Inspections API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves the results of database instance inspections. This API helps in assessing the health and performance of the database. ```APIDOC API Name: GetInstanceInspections Permission: hdm:GetInstanceInspections Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getinstanceinspections ``` -------------------------------- ### Get Query Optimize Solution API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves recommended solutions for query optimization issues. This API provides actionable advice to improve query performance. ```APIDOC API Name: GetQueryOptimizeSolution Permission: hdm:GetQueryOptimizeSolution Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizesolution ``` -------------------------------- ### Get Error Request Sample API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Fetches sample error requests from the database. This helps in identifying and debugging problematic queries or operations. ```APIDOC API Name: GetErrorRequestSample Permission: hdm:GetErrorRequestSample Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-geterrorrequestsample ``` -------------------------------- ### GetDeadlockHistogram API Successful Response Example Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getdeadlockhistogram An example of a successful JSON response returned by the GetDeadlockHistogram API, showing the structure and typical values for deadlock analysis data. ```JSON { "Code": 200, "Message": "Successful", "RequestId": "0A74B755-98B7-59DB-8724-1321B394****", "Success": true, "Data": [ { "UserId": "108************", "InstanceId": "pc-bp1u5mas9exx7****", "NodeId": "pi-bp16v3824rt73****", "TaskId": "B6D17591-B48B-4D31-9CD6-1321B394****", "StartTime": 1729994400000, "EndTime": 1729998000000, "LockNumber": 2, "Status": "SUCCESS" } ] } ``` -------------------------------- ### Get Event Subscription API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves details about event subscriptions configured for the database instance. This allows users to manage and monitor their notification settings. ```APIDOC API Name: GetEventSubscription Permission: hdm:GetEventSubscription Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-geteventsubscription ``` -------------------------------- ### Get Full Request Sample by Instance ID API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves sample full requests for a given database instance. This helps in analyzing the complete lifecycle of database operations. ```APIDOC API Name: GetFullRequestSampleByInstanceId Permission: hdm:GetFullRequestSampleByInstanceId Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getfullrequestsamplebyinstanceid ``` -------------------------------- ### Get Query Optimize Rule List API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Lists the available query optimization rules. This API helps users understand the rules applied by DAS for performance improvements. ```APIDOC API Name: GetQueryOptimizeRuleList Permission: hdm:GetQueryOptimizeRuleList Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizerulelist ``` -------------------------------- ### Get Instance SQL Optimize Statistic API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves SQL optimization statistics for a database instance. This provides data on how well SQL queries are performing and where optimizations can be made. ```APIDOC API Name: GetInstanceSqlOptimizeStatistic Permission: hdm:GetInstanceSqlOptimizeStatistic Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getinstancesqloptimizestatistic ``` -------------------------------- ### Get Query Optimize Tag API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Retrieves tags associated with query optimization. This helps in categorizing and managing different optimization scenarios or recommendations. ```APIDOC API Name: GetQueryOptimizeTag Permission: hdm:GetQueryOptimizeTag Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizetag ``` -------------------------------- ### GetQueryOptimizeSolution API Reference Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizesolution Comprehensive documentation for the `GetQueryOptimizeSolution` API, including interface specifications, authorization details, request parameters, response parameters, and error codes. This API is used to retrieve governance suggestions for SQL queries. ```APIDOC GetQueryOptimizeSolution API: Description: Call this API to obtain governance suggestions. Interface Notes: - Use the latest version of Alibaba Cloud or DAS SDKs. - When using SDKs to call DAS service, the region must be specified as 'cn-shanghai'. - Applicable database engines: RDS MySQL, PolarDB MySQL Edition, RDS PostgreSQL. Authorization Information: Action: hdm:GetQueryOptimizeSolution Access Level: get Resource Type: * (All Resources) Condition Keywords: None Associated Operations: None Request Parameters: Engine: Type: string Required: Yes Description: Database engine. Values: MySQL, PolarDBMySQL, PostgreSQL Example: MySQL SqlId: Type: string Required: Yes Description: SQL template ID. Can be queried using GetQueryOptimizeDataStats API. Example: 05fecf7e7b3efd123c4d5197035f**** RuleIds: Type: string Required: Yes Description: Rule ID. Refer to Query Governance documentation for details. Example: LARGE_ROWS_EXAMINED InstanceId: Type: string Required: No Description: Instance ID. Can be queried using GetQueryOptimizeDataStats API. Example: rm-bp1o3z6beqpej**** Response Parameters: Code: Type: string Description: Status code returned. Example: 200 Message: Type: string Description: Request return message. Example: Successful Data: Type: object Description: Detailed information list. Properties: Total: Type: long Description: Total data volume. Example: 1 PageNo: Type: integer Description: Reserved parameter. Example: None PageSize: Type: integer Description: Reserved parameter. Example: None Extra: Type: string Description: Reserved parameter. Example: None List: Type: array Description: Governance suggestion list. Properties: QueryOptimizeSolutions: Type: object Description: Governance suggestion list. Properties: Level: Type: string Description: Suggestion level. Values: INFO (Information), WARN (Warning) Example: INFO RuleId: Type: string Description: Rule ID. Refer to Query Governance documentation for details. Example: LARGE_ROWS_EXAMINED Solution: Type: string Description: Solution. Refer to Query Governance documentation for details. Example: LARGE_ROWS_EXAMINED_SOLUTION SolutionExt: Type: string Description: Reserved parameter. Example: None RequestId: Type: string Description: Request ID. Example: 30FF4E40-17F3-5A51-AB23-43F30D9B**** Success: Type: string Description: Whether the request executed successfully. Values: true (Success), false (Failure) Example: true Error Codes: HTTP Status Code: 400 Error Code: InvalidParams Error Message: The request parameters are invalid. Description: Request parameter error. HTTP Status Code: 403 Error Code: NoPermission Error Message: You are not authorized to do this action. Description: No permission to execute this operation. ``` -------------------------------- ### GetMySQLAllSessionAsync API Reference Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getmysqlallsessionasync Detailed API documentation for the GetMySQLAllSessionAsync interface. This API asynchronously retrieves and statistically analyzes current session data for RDS MySQL, PolarDB MySQL, and PolarDB-X 2.0 instances. It requires a two-step call: first to get a ResultId, then subsequent calls with the ResultId until the result is complete. The documentation includes interface description, authorization details, and request parameters. ```APIDOC API: GetMySQLAllSessionAsync Description: Asynchronously retrieves and statistically analyzes current session data for database instances. Note: - This is an asynchronous API. First call to get a ResultId, then use the ResultId in subsequent calls until 'isFinish' is true. Requires at least two calls for complete data. - For RDS MySQL 8.0 instances, minor versions less than 20230610 may cause deadlocks when concurrently executing COM_STATISTICS, COM_CHANGE_USER, and SHOW PROCESSLIST. It is recommended to upgrade to the latest minor version. Applicable Instances: RDS MySQL, PolarDB MySQL, PolarDB-X 2.0. SDK Usage: - Use the latest SDK version. - When using the SDK to call DAS service, specify the region as 'cn-shanghai'. Authorization Information: - Action: hdm:GetMySQLAllSessionAsync - Access Level: get - Resource Type: *All Resources - Condition Keywords: None - Associated Operations: None Request Parameters: - Name: InstanceId Type: string Required: Yes Description: Instance ID. Only supports RDS MySQL, PolarDB MySQL, and PolarDB-X 2.0 instances. Example: rm-2ze8g2am97624**** - Name: NodeId Type: string Required: No Description: Node ID. Required for PolarDB MySQL instances. If not specified, returns session data for the primary node by default. Example: pi-wz954ryd8f893**** - Name: ResultId Type: string Required: No Description: Asynchronous request ID. Used for subsequent calls to retrieve complete results. Asynchronous calls do not return complete results immediately; first call to get a ResultId, then use the ResultId from the returned data to re-initiate the call until 'isFinish' is true, returning complete results. This means at least two calls are required to get complete data. Example: async__507044db6c4eadfa2dab9b084e80**** ``` -------------------------------- ### Example JSON Response for Auto SQL Throttling Rules API Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getautothrottlerules A complete JSON object demonstrating a typical successful response from the API, showcasing the data structure and values for various auto SQL throttling rule states, including enabled, disabled, and never-enabled instances. ```JSON { "Code": 200, "Message": "Successful", "Data": { "TotalAutoThrottleRulesCount": 3, "EnableAutoThrottleCount": 1, "TurnOffAutoThrottleCount": 1, "NeverEnableAutoThrottleOrReleasedInstanceCount": 1, "EnableAutoThrottleList": [ { "AbnormalDuration": 2, "CpuUsage": 70, "CpuSessionRelation": "AND", "ActiveSessions": 32, "MaxThrottleTime": 10, "AllowThrottleStartTime": "00:00Z", "AllowThrottleEndTime": "23:59Z", "Visible": true, "AutoKillSession": true, "InstanceId": "rm-2ze8g2am97624****", "UserId": "140692647406****" } ], "TurnOffAutoThrottleList": [ { "AbnormalDuration": 2, "CpuUsage": 80, "AllowThrottleEndTime": "23:59Z", "InstanceId": "rm-2ze9xrhze0709****", "Visible": false, "CpuSessionRelation": "OR", "AutoKillSession": true, "ActiveSessions": 64, "MaxThrottleTime": 10, "UserId": "140692647406****", "AllowThrottleStartTime": "00:00Z" } ], "NeverEnableAutoThrottleOrReleasedInstanceIdList": [ "rm-2 ``` -------------------------------- ### Get Query Optimize Share URL API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Generates a shareable URL for query optimization results. This facilitates collaboration and sharing of performance analysis with team members. ```APIDOC API Name: GetQueryOptimizeShareUrl Permission: hdm:GetQueryOptimizeShareUrl Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizeshareurl ``` -------------------------------- ### Get Query Optimize Exec Error Sample API for Aliyun DAS Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-ram Fetches sample execution errors related to query optimization. This helps in identifying and debugging issues that prevent optimal query performance. ```APIDOC API Name: GetQueryOptimizeExecErrorSample Permission: hdm:GetQueryOptimizeExecErrorSample Method: get Resource Scope: *全部资源* Documentation Link: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-getqueryoptimizeexecerrorsample ``` -------------------------------- ### API Reference: CreateQueryOptimizeTag - Tag SQL Queries Source: https://help.aliyun.com/zh/das/developer-reference/api-das-2020-01-16-createqueryoptimizetag Detailed documentation for the Alibaba Cloud DAS `CreateQueryOptimizeTag` API. This API allows users to apply specific tags to SQL queries, aiding in their categorization and optimization. It supports various database engines like RDS MySQL, PolarDB MySQL, and RDS PostgreSQL. The documentation includes interface notes, authorization details, comprehensive request and return parameter specifications, and an example JSON response. ```APIDOC API: CreateQueryOptimizeTag Description: Call the CreateQueryOptimizeTag interface to tag target SQL. Interface Notes: - Use the latest version of Alibaba Cloud or DAS SDKs. - When using SDKs to call DAS services, the region must be specified as cn-shanghai. - Applicable database engines: + RDS MySQL + PolarDB MySQL + RDS PostgreSQL Authorization Information: - Action: hdm:CreateQueryOptimizeTag - Access Level: update - Resource Type: *all resources* - Condition Keywords: None - Related Operations: None Request Parameters: - Engine (string, required): Database engine. Values: MySQL, PolarDBMySQL, PostgreSQL. Example: MySQL - SqlIds (string, required): SQL template IDs, comma-separated. You can query SQL template IDs using the GetQueryOptimizeDataStats interface. Supports batch tagging by passing multiple IDs. Example: 6068ce044e3dc9b903979672fb0b69df,d12515c015fc9f41a0778a9e1de0**** - Tags (string, required): SQL tags, comma-separated. Values: + DAS_IMPORTANT: Important SQL. + DAS_NOT_IMPORTANT: Not important SQL. + USER_IGNORE: No optimization needed. + DAS_IN_PLAN: Optimization scheduled. Example: DAS_IN_PLAN,DAS_NOT_IMPORTANT - Status (integer, required): Status for the Tags parameter: + 0: Clear all tags corresponding to SqlIds (ignore Tags setting). + 1: Set tags corresponding to SqlIds to the value of Tags. Example: 1 - Comments (string, optional): Remarks. Length: 1-300 characters. Example: Offline sync slow SQL, no optimization needed. - InstanceId (string, required): Instance ID. Example: rm-2ze1jdv45i7l6**** Return Parameters: - Code (string): Status code. Example: 200 - Message (string): Request return message. Returns "Successful" on success, or request exception information (e.g., error code) on failure. Example: Successful - RequestId (string): Unique identifier generated by Alibaba Cloud for this request. Example: B6D17591-B48B-4D31-9CD6-9B9796B2**** - Success (string): Whether the request executed successfully. Values: true (success), false (failure). Example: true - Data (boolean): Whether the tagging operation executed successfully. Values: true (success), false (failure). Example: true Error Codes: - HTTP 400, InvalidParams: The request parameters are invalid. (请求参数错误) - HTTP 403, NoPermission: You are not authorized to do this action. (没有权限执行该操作) Example Response (JSON): { "Code": 200, "Message": "Successful", "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****", "Success": true, "Data": true } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.