Updated on 2024-06-07 GMT+08:00

Querying SQL Statement Concurrency Control Rules

Function

This API is used to query SQL statement concurrency control rules.

  • Before calling an API, you need to understand the API in Authentication.

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

    Project ID of a tenant in a region.

    To obtain it, refer to Obtaining a Project ID.

    instance_id

    Yes

    String

    Instance ID.

    db_name

    Yes

    String

    Database name.

    offset

    No

    Integer

    Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number.

    limit

    No

    Integer

    Number of query records. The default value is 10. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

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

    Number of SQL statement concurrency control rules.

    sql_limit_objects

    Array of objects

    Concurrency control rule details.

    For details, see Table 3.

    Table 3 sql_limit_objects field data structure description

    Parameter

    Type

    Description

    id

    String

    Concurrency control rule ID.

    query_id

    String

    Internal hash code calculated by the SQL parse tree. The default value is 0. The value range is from -9223372036854775808 to 9223372036854775807.

    query_string

    String

    Text format of an SQL statement.

    max_concurrency

    Integer

    Number of SQL statements that can be executed at the same time. If the value is less than or equal to 0, the number is not limited. The default value is 0. The value range is from -1 to 50000.

    is_effective

    Boolean

    Wether the rule is effective.

    max_waiting

    Integer

    Maximum waiting time, in seconds.

    search_path

    String

    Schema search order set for names that are not schema-qualified. The default value is 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.