Sobes.tech
Middle

Tell me about types of indexes. What are they and which ones have you used most often?

sobes.tech AI

Answer from AI

Databases have different types of indexes that help speed up data search and sorting:

  • B-Tree index — the most common type, suitable for equality and range queries. Used by most DBMSs by default.
  • Hash index — effective for fast exact matches, but does not support range queries.
  • Bitmap index — well-suited for columns with low cardinality (e.g., gender, status), often used in analytical databases.
  • Full-text index — for full-text search on text fields.
  • Spatial index — for geographic data and spatial queries.

Most often, I used B-Tree indexes because they are versatile and support a wide range of queries. I also used full-text indexes for text search and hash indexes to speed up exact matches in some cases.