CreateSqlPatternCompareReport

Updated at:
Copy as MD

Creates a SQL pattern comparison report.

Operation description

Compares two time windows and asynchronously generates a SQL pattern comparison report.

Note
  • The start time of each window must be earlier than the end time, and the duration must not exceed 24 hours. Select windows of the same duration and similar business cycles.

  • The returned ReportId only indicates that the request has been accepted. Call DescribeSqlPatternCompareReports to query the report status, and query the details when DetailEnabled is true.

  • Only one report can be generated for an instance at a time.

  • Reports are valid for 7 days and are isolated by instance and Alibaba Cloud account.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the instance.

cn-beijing

DBClusterId

string

Yes

The ID of the AnalyticDB for MySQL cluster.

am-2ze1234567890****

StartTime

string

Yes

The start time of time window 1. Specify the time in UTC in the yyyy-MM-ddTHH:mmZ or yyyy-MM-ddTHH:mm:ssZ format.

2026-09-07T00:00Z

EndTime

string

Yes

The end time of time window 1. Specify the time in UTC in the yyyy-MM-ddTHH:mmZ or yyyy-MM-ddTHH:mm:ssZ format.

2026-09-07T01:00Z

CompareStartTime

string

Yes

The start time of time window 2. Specify the time in UTC in the yyyy-MM-ddTHH:mmZ or yyyy-MM-ddTHH:mm:ssZ format.

2026-09-08T00:00Z

CompareEndTime

string

Yes

The end time of time window 2. Specify the time in UTC in the yyyy-MM-ddTHH:mmZ or yyyy-MM-ddTHH:mm:ssZ format.

2026-09-08T01:00Z

PatternType

string

Yes

The report type. Valid values:

  • NEW: Patterns that are new in time window 2.

  • CHANGED: Patterns that exist in both time windows and have an increased average value in at least one metric.

Valid values:

  • NEW :

    New SQL patterns.

  • CHANGED :

    SQL patterns with increased metrics.

CHANGED

Response elements

Element

Type

Description

Example

object

The response for creating a report. The report content is generated asynchronously.

ReportId

integer

The ID of the created report. This value only indicates that the request has been accepted.

1001

RequestId

string

The request ID.

9A1B2C3D-4E5F-6789-ABCD-0123456789AB

Examples

Success response

JSON format

{
  "ReportId": 1001,
  "RequestId": "9A1B2C3D-4E5F-6789-ABCD-0123456789AB"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.