# `mix pgflow_dashboard.gen.indexes`
[🔗](https://github.com/agoodway/pgflow/blob/v0.1.0/lib/mix/tasks/pgflow_dashboard.gen.indexes.ex#L1)

Generates an Ecto migration that adds performance indexes to pgflow tables
for faster dashboard queries.

## Usage

    mix pgflow_dashboard.gen.indexes
    mix pgflow_dashboard.gen.indexes --migrations-path priv/repo/migrations

## Options

  * `--migrations-path` - Path to the migrations directory.
    Defaults to `priv/repo/migrations`.

## Generated Indexes

This migration creates the following indexes:

  * `idx_runs_started_at` - For time-range filtering
  * `idx_runs_flow_status_started` - For filtered run lists
  * `idx_runs_completed_at` - For duration calculations
  * `idx_step_states_status` - For progress calculations

## Note

These indexes are optional and primarily benefit dashboards with high query load.
For small deployments, the default indexes may be sufficient.

## Example

    # Generate the migration
    $ mix pgflow_dashboard.gen.indexes

    # Run the migration
    $ mix ecto.migrate

---

*Consult [api-reference.md](api-reference.md) for complete listing*
