Docs

Indexes

Indexes let you define database indexes on your table columns. Use them to document primary keys, unique constraints, and performance indexes directly in your schema.

Index editing in the left panel

Single-column indexes

The quickest way to index a single column is through the column's Index type dropdown in the left panel. Choose from:

  • Primary — primary key constraint. Shown with a key icon on the canvas.

  • Unique — unique constraint. Shown with a snowflake icon on the canvas.

  • Index — regular index for query performance.

This is all you need for most columns—no separate index entry required.

Composite (compound) indexes

A composite index spans multiple columns. These are common for compound primary keys (e.g., a join table with two foreign keys) or multi-column unique constraints.

Adding a composite index

Select a table, then click Add Index in the left panel (or press Ctrl+' / Cmd+'). Each index row has two controls:

  • Columns — a multi-select dropdown listing all columns in the table. Select two or more columns to include in the index.

  • Type — choose Primary, Unique, or Index.

On the canvas, composite indexes appear in a dedicated section below the columns. Each row shows a type icon and the included column names as a comma-separated list.

Reordering

Drag indexes using the handle that appears on hover to reorder them within the indexes section.

Notes

  • The indexes section on the canvas is hidden when a table has no composite indexes.

  • Deleting a column automatically removes it from any indexes it belongs to.

Still have a question? We'd love to help!