---
title: "analytics insights"
description: "Show project query insights"
canonical: "https://pgbeam.com/docs/cli/analytics/insights"
last-updated: "2026-10-29T19:01:20.000Z"
---

# analytics insights

> Show project query insights

URL: https://pgbeam.com/docs/cli/analytics/insights

{/* Auto-generated from CLI commands. Do not edit. Run `pnpm generate:cli-docs` to regenerate. */}

Display query performance insights for the linked project, including cache hit rate, average and P99 latency, and the top queries by call count. Use `--range` to adjust the time window.

## Usage

```bash
pgbeam analytics insights [flags]
```

## Options

| Option            | Description                                  | Required | Default |
| ----------------- | -------------------------------------------- | -------- | ------- |
| `--range <value>` | Time window for insights: 1h, 6h, 24h, or 7d | No       | `24h`   |

> **Global options**
>
> All [global options](/docs/cli/global-options) (`--token`, `--profile`,
> `--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
> also available on this command.

## Examples

```bash
# Show insights for the last 24 hours (default)
pgbeam analytics insights

# Show insights for the last hour
pgbeam analytics insights --range 1h

# Show insights for the last 7 days
pgbeam analytics insights --range 7d

# Get insights as JSON
pgbeam analytics insights --json
```

## Output

Displays cache hit rate, average latency, and P99 latency, followed by a table of top queries with columns: Query (truncated), Count, Avg (ms), and Cache Hits. With `--json`, returns the full insights response.