Sobes.tech
Junior — Middle

What type of composite index is used for multiple fields in a database?

sobes.tech AI

Answer from AI

A composite (or composite) index is used for indexing multiple fields in a database. It is created based on several columns of a table and allows faster queries that filter or sort data by these fields simultaneously.

For example, in SQL:

CREATE INDEX idx_name ON table_name (column1, column2);

Such an index is effective for queries with conditions on column1 and column2 together, but not always useful for queries only on column2.