---
title: "(BETA) Run ANALYZE TABLE for tables in a database instance"
method: POST
path: "/api/v1/ailake/database/instances/{instanceId}/analyzeStatistics"
tags: ["AI Lake - Databases"]
---

# (BETA) Run ANALYZE TABLE for tables in a database instance

`POST /api/v1/ailake/database/instances/{instanceId}/analyzeStatistics`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/ailake/database/instances/{instanceId}/analyzeStatistics`
- Auth: none declared

(BETA) Collects CBO statistics for tables in a StarRocks database. Works for both internal (native) and external (Iceberg) catalogs. If tableNames is empty, all tables are analyzed.

## Path parameters

- `instanceId` string, required: Database instance identifier. Accepts the database name (preferred) or UUID.

## Headers

- `operation-id` string

## Request body

- AnalyzeStatisticsRequest: Request to run ANALYZE TABLE for tables in a database instance
  - `tableNames` string[]: Table names to analyze. If empty or null, all tables in the database are analyzed.

## Response `202`

Statistics analysis scheduled.

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
