ColdPlane Docs
Guides

Querying Data

Run SQL queries against your archived cold storage data.

ColdPlane lets you query archived data directly using SQL without rehydrating to a live database.

Basic Query

coldplane query run \
  --backup-id bck_abc123 \
  --table users \
  --sql "SELECT count(*) as total_users FROM users"

By default, queries return a 100-row preview. To download the full result set, use the --export flag.

Exporting Full Results

Export full query results as CSV or Parquet for download:

# Export as CSV (default)
coldplane query run \
  --backup-id bck_abc123 \
  --table users \
  --sql "SELECT id, email, created_at FROM users WHERE created_at > '2024-01-01'" \
  --export --format csv

# Export as Parquet (compact, typed columns)
coldplane query run \
  --backup-id bck_abc123 \
  --table orders \
  --sql "SELECT id, amount, status FROM orders" \
  --export --format parquet

Exported results are stored temporarily and available for download based on your plan's retention period.

Result Retention

Exported results are automatically cleaned up after your plan's retention period:

PlanRetention
Free24 hours
Starter3 days
Pro7 days
Team14 days
Enterprise30 days

If a result expires, simply re-run the query — your archived data is always available.

Performance Tips

  • Specify explicit columns -- SELECT * is not allowed; list the columns you need
  • Use WHERE clauses -- partition pruning reduces data scanned
  • Prefer aggregations -- COUNT, SUM, AVG process data server-side
  • Limit results -- use LIMIT to cap large result sets

Export file size is capped per plan (10 MB free, up to 250 MB on Team/Enterprise). If your result exceeds the cap, narrow your query with WHERE or LIMIT.