# Working with cardinality statistics

Cardinality statistics are gathered on the keys of an index when the index is created.

- When cardinality statistics are automatically updated
  For the following operations that you perform on a table, Derby automatically creates new statistics or updates existing statistics.
- When cardinality statistics go stale
  Cardinality statistics are automatically updated only in limited cases. Normal insert, update, and delete statements do not cause the statistics to be updated. This means that statistics can go stale.

Parent topic: Selectivity and cardinality statistics
Related concepts
Determinations of rows scanned from disk for a table scan
Estimations of rows scanned from disk for an index scan
Statistics-based versus hard-wired selectivity
What are cardinality statistics?