---
title: "(BETA) Collect physical table and column statistics from a data source"
method: POST
path: "/api/v1/actions/dataSources/{dataSourceId}/scanStatistics"
tags: ["Other"]
---

# (BETA) Collect physical table and column statistics from a data source

`POST /api/v1/actions/dataSources/{dataSourceId}/scanStatistics`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/actions/dataSources/{dataSourceId}/scanStatistics`
- Auth: none declared

(BETA) Reads the statistics the database already maintains in its own catalog, without scanning any data. Supported for StarRocks (both internal catalog for native/PIPE tables and external catalog for Iceberg tables), BigQuery, PostgreSQL, Redshift, Snowflake, Vertica, SQL Server, Azure SQL, MySQL, MariaDB and SingleStore. Statistics include row counts and data sizes, and, where the database exposes them, NDV (number of distinct values), null counts and min/max values. Returns an empty result for a data source whose database exposes no such catalog. Also returns an empty result for a data source that sets disableStatistics.

## Path parameters

- `dataSourceId` string, required

## Request body

- TableStatisticsRequest
  - `schemata` string[], required
  - `tableNames` string[]

## Response `200`

OK

- TableStatisticsResponse
  - `tables` TableStatisticsEntry[], required
    - `columns` ColumnStatisticsEntry[], required
      - `columnName` string, required
      - `dataSize` integer: Total data size of the column in bytes.
      - `max` string: Maximum value in the column (string-encoded).
      - `min` string: Minimum value in the column (string-encoded).
      - `ndv` integer: NDV (Number of Distinct Values) — approximate cardinality of the column.
      - `nullCount` integer: Number of NULL values in the column.
    - `dataSize` integer: Total data size of the table in bytes.
    - `rowCount` integer: Total number of rows in the table.
    - `schemaName` string, required
    - `tableName` string, required
  - `warnings` TableStatisticsWarning[], required
    - `message` string, required
    - `tableName` string

---

[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)
