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

Querying SQL Throttling Rules

Function

This API is used to query SQL throttling rules.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/sql-limit?db_name={db_name}&offset={offset}&limit={limit}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    String

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    db_name

    Yes

    String

    Definition

    Database name.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    offset

    No

    Integer

    Definition

    Index offset. The query starts from the next piece of data indexed by this parameter.

    Constraints

    N/A

    Range

    The value must be a non-negative number.

    Default Value

    The default value is 0, indicating that the query starts from the first data record.

    limit

    No

    Integer

    Definition

    Number of records returned by a query.

    Constraints

    N/A

    Range

    1–100

    Default Value

    10

Request

None

Example Request

GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/49b9dd1d6f464ba4bc91df5cbd2e52ebin03/sql-limit?db_name=postgres&offset=0&limit=10

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    count

    Integer

    Definition

    Number of SQL throttling rules.

    Range

    N/A

    sql_limit_objects

    Array of objects

    Definition

    SQL throttling rule details.

    For details, see Table 3.

    Table 3 sql_limit_objects field data structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    SQL throttling rule ID.

    Range

    N/A

    query_id

    String

    Definition

    Internal hash code calculated by the SQL parse tree.

    Range

    -9223372036854775808 to 9223372036854775807. The default value is 0.

    query_string

    String

    Definition

    Text format of an SQL statement.

    Range

    N/A

    max_concurrency

    Integer

    Definition

    Number of SQL statements that can be executed at the same time.

    Range

    -1–50000. If the value is less than or equal to 0, the number is not limited. The default value is 0.

    is_effective

    Boolean

    Definition

    Whether the rule is effective.

    Range

    N/A

    max_waiting

    Integer

    Definition

    Maximum waiting time, in seconds.

    Range

    N/A

    search_path

    String

    Definition

    Schema search order set for names that are not schema-qualified.

    Range

    public

  • Example normal response
    {
        "count": 2,
        "sql_limit_objects": [
            {
                "id": "3",
                "query_id": "1147616880456321454",
                "query_string": "select 1;",
                "max_concurrency": 10,
                "is_effective": false,
                "max_waiting": 10,
                "search_path": "public"
            },
            {
                "id": "4",
                "query_id": "-7472493489976133824",
                "query_string": "select * from pg_type;",
                "max_concurrency": 10,
                "is_effective": false,
                "max_waiting": 10,
                "search_path": "public"
            }
        ]
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.