✏️ Explanatory Question

When to use single-column index or a composite index?

👁 461 Views
📘 Detailed Answer
💡

Answer with Explanation

To create a single-column index or a composite index, take into consideration the column(s) that you may use very frequently in a query's WHERE clause as filter conditions.

Should there be only one column used, a single-column index should be the choice. Should there be two or more columns that are frequently used in the WHERE clause as filters, the composite index would be the best choice.