# PROFILE TABLE — discover a table's shape

Schema discovery over schemaless data — the statement you run *first* against a table you didn't design. One result row per attribute: coverage against the sample, type distribution ("Number 94% · String 6%"), NULL vs MISSING vs empty counts, and a "mixed types" note when an attribute carries more than one shape.

## Syntax

```sql
PROFILE TABLE "table"
[WHERE predicates]   -- bounds what's sampled
[LIMIT n]            -- bounds the rows read
```

A profile that hits the read cap returns a **disclosed partial sample** ("sampled the first N items — the table continues") rather than refusing — unlike an aggregate, a sample is an honest answer. Guide: [Aggregates & profiling](https://www.kanject.com/docs/dynostudio-partiql-aggregates/).

## Use cases

### Meet an unfamiliar table

Inherited a production table with no docs? Profile it before you query it — the attribute list, their types, and how consistently they're present.

```sql
PROFILE TABLE "stage.Orders"
```

_Executes as:_ Sampled read (capped at 100 pages) → one result row per attribute

- Every sampled item is read and billed like any read — the cap keeps the bill bounded on big tables.

_Quote this example:_ https://www.kanject.com/docs/dynostudio-profile-table/#profile-whole-table

### Profile one tenant's slice

In a shared table, different tenants can carry different shapes — `WHERE` bounds what's sampled and `LIMIT` bounds the rows read.

```sql
PROFILE TABLE "stage.Orders"
WHERE tenantId = 'kanject' LIMIT 5000
```

_Executes as:_ Sampled read of the matching slice · LIMIT 5000

_Quote this example:_ https://www.kanject.com/docs/dynostudio-profile-table/#profile-scoped

## Try it

**Try it · PROFILE TABLE**

```sql
PROFILE TABLE "stage.Orders" LIMIT 5000
```

_Executes as:_ Sampled read · stage.Orders → profile — The sample is disclosed: 5,000 of ~48,000 items — a partial profile is an honest answer.

_Run it live in DynoStudio:_ https://www.kanject.com/dynostudio/

> **Profile first, index second:** The coverage column tells you which attributes are reliable enough to key a GSI on — an attribute present on 11% of items makes a sparse index (sometimes exactly what you want), one at 100% makes a dependable read path.

Related: [Aggregates & profiling](https://www.kanject.com/docs/dynostudio-partiql-aggregates/) · [SELECT](https://www.kanject.com/docs/dynostudio-select/) · [Tables, indexes & replicas](https://www.kanject.com/docs/dynostudio-partiql-ddl/) for `CREATE GSI`.

---
_Source: https://www.kanject.com/docs/dynostudio-profile-table/ · Kanject Docs_
