# X_ENTITY_RETAIN_UNINDEXED

## Means

entity({ retain }) names a column no index leads with

## Typical cause

retain.on is a timestamp column with no index that starts with it, so every sweep would scan the whole table

## Fix

`add { on: ['createdAt'] } to indexes in the entity's declaration, then x db gen "index retain column"`

[Entity and database](/error-codes#entity-and-database)
