ACR Rules

⌘K
  1. Home
  2. Docs
  3. ACR Rules
  4. Performance (29)
  5. Keep the number of index columns low

Keep the number of index columns low

Introduced in version 1.10 (May 2020)

More than a few columns hardly ever increase performance. In rare cases making sure an index has all the needed columns prevents a read of the table row.

The default is max 3 index columns.

Here are some tips by Martin Leppen:

Don’t put an index on every single attribute (or attributes with little variance).
Each index creates a new table and makes your database larger. Each update on an object also results in an update on all relevant index tables. Next to that, putting indexes on attributes where most values are the same (for example booleans), won’t really benefit the performance, since most of the table will still need to be evaluated.

Indexes are most useful on entities for which the amount of retrieves is far bigger than the number of changes.
Indexes slightly decrease the performance of table updates, because index tables need to be updated as well, but they greatly improve the performance of retrieves.

Additional resources on indices