# CREATE ANALYTICS REPLICA — move reporting off the live table

When a report should stop reading the live table, provision a DynamoDB to Amazon **S3 Tables zero-ETL replica**. DynoStudio expands the statement into the ordered AWS setup plan — PITR and resource-policy checks, the S3 Tables bucket and analytics catalog, Lake Formation and Glue wiring, the IAM service role, and the integration itself — with **every native call, likely permission gap, and recurring cost line previewed before consent**.

## Syntax

```sql
CREATE ANALYTICS REPLICA [IF NOT EXISTS] FOR TABLE "table"
  [WITH (refresh_interval = INTERVAL 'n' HOUR, unnest = FULL)]

ALTER ANALYTICS REPLICA FOR TABLE "table" SET setting = value

DROP ANALYTICS REPLICA FOR TABLE "table"
```

Routing stays explicit: DynoStudio does not silently reroute a live-table query — replica reads carry their own engine and cost disclosure when routed there, just as Query vs Scan is visible today. Guide: [Tables, indexes & replicas](https://www.kanject.com/docs/dynostudio-partiql-ddl/#s3-tables-analytics-replicas).

## Use cases

### Provision a replica (resume-friendly)

Stand up the analytics copy of a busy orders table. `IF NOT EXISTS` makes the create path resumable — a provision that stopped partway continues from the saved step instead of re-minting resources.

```sql
CREATE ANALYTICS REPLICA IF NOT EXISTS FOR TABLE "stage.Orders"
  WITH (refresh_interval = INTERVAL '1' HOUR, unnest = FULL)
```

_Executes as:_ Ordered plan: PITR check → S3 Tables bucket + catalog → Lake Formation/Glue wiring → IAM role → Glue integration

- The preview lists the plan's native calls, the permissions it will likely need, and the recurring cost lines — consent comes after the disclosure, never before.

_Quote this example:_ https://www.kanject.com/docs/dynostudio-analytics-replica/#provision-replica

### Slow the refresh cadence down

The report runs daily; an hourly refresh buys nothing. `ALTER … SET` updates supported settings — and warns when a change can force a full resync.

```sql
ALTER ANALYTICS REPLICA FOR TABLE "stage.Orders"
  SET refresh_interval = INTERVAL '12' HOUR
```

_Executes as:_ Update integration settings · warns if the change forces a full resync

_Quote this example:_ https://www.kanject.com/docs/dynostudio-analytics-replica/#retune-refresh

### Tear the replica down

Reporting moved elsewhere — remove the integration through the same gated control-plane path it was created by.

```sql
DROP ANALYTICS REPLICA FOR TABLE "stage.Orders"
```

_Executes as:_ Gated teardown of the zero-ETL integration

_Quote this example:_ https://www.kanject.com/docs/dynostudio-analytics-replica/#teardown-replica

## Try it

**Try it · ANALYTICS REPLICA**

```sql
CREATE ANALYTICS REPLICA IF NOT EXISTS FOR TABLE "stage.Orders"
  WITH (refresh_interval = INTERVAL '1' HOUR, unnest = FULL)
```

_Executes as:_ Provisioning plan · stage.Orders → S3 Tables — Five ordered steps, each a disclosed native call — the preview also lists likely permission gaps and recurring costs. Nothing provisions until you consent to the previewed plan.

_Result:_ Plan previewed · 5 steps · recurring costs listed · awaiting consent

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

> **The cost moved — it did not vanish:** Exports for the integration don't consume live-table RCUs, but the replica has its own bill: PITR storage, export GB, S3 Tables storage and compaction, plus read-side compute when you query it. The preview shows that trade before provisioning.

Related: [Tables, indexes & replicas](https://www.kanject.com/docs/dynostudio-partiql-ddl/) · [Aggregates & profiling](https://www.kanject.com/docs/dynostudio-partiql-aggregates/) for the folds that push tables toward a replica · the [DynoStudio overview](https://www.kanject.com/docs/dynostudio/) for the Analytics surface.

---
_Source: https://www.kanject.com/docs/dynostudio-analytics-replica/ · Kanject Docs_
