---
title: "list top sqls"
method: POST
path: "/api/v1/sql/topSqls"
tags: ["Sql"]
---

# list top sqls

`POST /api/v1/sql/topSqls`

list top sqls ordering by spcecific metrics

## Request body

- SqlSqlFilter
  - `database` string
  - `endTime` integer
  - `includeInnerSql` boolean
  - `keyword` string
  - `namespace` string, required
  - `obcluster` string, required
  - `obtenant` string
  - `startTime` integer
  - `user` string

## Response `200`

OK

- object
  - `data` SqlSqlInfo[], required
    - `database` string, required
    - `diagnoseInfo` SqlSqlDiagnoseInfo[]
      - `reason` string, required
      - `suggestion` string
    - `executionStatistics` SqlSqlStatisticMetric[], required
      - `name` string, required
      - `value` number, required
    - `isInner` boolean, required
    - `latencyStatistics` SqlSqlStatisticMetric[], required
      - `name` string, required
      - `value` number, required
    - `observer` string, required
    - `sqlID` string, required
    - `sqlText` string, required
    - `sqlType` string, required
    - `tenant` string, required
    - `user` string, required
  - `message` string, required
  - `successful` boolean, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

## Changes

- **2024-09-04** `14770a73a389` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/oceanbase/apis/oceanbase-dashboard-api/changes/api/v1/sql/topSqls/post.md)

---

[API](https://skmtc.dev/oceanbase/apis/oceanbase-dashboard-api.md) · [All operations](https://skmtc.dev/oceanbase/apis/oceanbase-dashboard-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/oceanbase/oceanbase-dashboard-api/revisions/3e1a27cd744f/schema)
