Skip to main content
Products -> ERDPricingDocsBlogSign in한국어Start with ERD

Indexes

Indexes let you document the indexing strategy for your tables directly in the ERD. Define single-column indexes, composite indexes, and unique constraints — all from the table edit panel.


Access the Indexes section

  1. Click a table on the canvas to open the edit panel
  2. Scroll down to the Indexes section (below Columns and Foreign Keys)

Add an index

  1. Click + Add Index in the Indexes section
  2. Configure the index properties:
PropertyDescription
NameIndex name (e.g., idx_users_email, idx_orders_status_date)
ColumnsOne or more columns included in the index
UniqueWhether this index enforces a uniqueness constraint
  1. Select columns from the dropdown — the list shows all columns defined on the current table
  2. The index is saved along with the table

Composite indexes

A composite index spans multiple columns. This is useful for queries that filter or sort on combinations of fields.

To create a composite index:

  1. Click + Add Index
  2. Enter the index name
  3. Add multiple columns — select each column from the dropdown
  4. The column order in the index matters for query optimization — arrange them according to your most common query patterns

Example

For an orders table with frequent queries filtering by status and created_at:

PropertyValue
Nameidx_orders_status_created
Columnsstatus, created_at
UniqueNo

Unique indexes

Toggle the Unique checkbox to mark an index as unique. A unique index enforces that no two rows can have the same combination of values in the indexed columns.

Common use cases:

TableColumnsPurpose
usersemailEnsure no duplicate emails
team_membersteam_id, user_idPrevent duplicate memberships
slugsresource_type, slugUnique slug per resource type

Edit an index

Click on an existing index in the Indexes section to expand it. You can:

  • Rename the index
  • Add or remove columns
  • Toggle the unique flag

Changes are saved with the table.


Delete an index

Click the delete icon next to the index row to remove it.


Tips

  • Follow a consistent naming convention for indexes — e.g., idx_{table}_{columns} makes indexes easy to identify in migration scripts
  • Put the most selective column first in composite indexes — this helps the database optimizer choose the index efficiently
  • Use unique indexes to enforce business rules at the database level (not just application level)
  • When exporting your schema to SQL, indexes are included in the generated DDL statements
  • Document indexes in your ERD even if they are already in your migration files — it helps the team see the full picture at a glance