Sobes.tech
Junior — Middle

When is the absence of an index in a database justified and recommended to avoid creating it?

sobes.tech AI

Answer from AI

The absence of an index in the database is justified and recommended in the following cases:

  • Tables with a small number of records. Indexes on small tables may not provide a performance boost and only increase update overhead.

  • Columns with low selectivity. If a column contains few unique values (e.g., boolean fields), an index on it will be ineffective.

  • Frequent insert, update, delete operations. Indexes slow down these operations, so if a table is heavily modified, it is better to avoid unnecessary indexes.

  • If queries do not use the column in filtering or sorting conditions. An index will just occupy space and slow down write operations.

Thus, indexes should only be created where they genuinely improve read performance, and avoided where they create unnecessary overhead.

When is the absence of an index in a database… - sobes.tech