Relational Database Service (MySQL)

Recommendations

2024-06-21 08:07:13

• Use no more than five indexes in a single table and no more than five fields in a single index to avoid excessive filtering and resource consumption of indexes.

• Ensure that the index field length is fixed and not too long. Excessively long index fields can occupy more disk space and affect index performance.

• Avoid redundant indexes. For example, if there are two indexes (a, b) and (a), when the query condition is Column a, you only need to build the (a, b) index, and you do not need to build an additional (a) index.

• Consider indexing highly filtered fields to improve query efficiency.

• Note the selectivity and data types. Highly selective fields and appropriate data types can improve indexing and query performance.

• Reasonable use of covering indexes can reduce I/O overhead. You can create a compound index containing the required columns to avoid back-to-table operations.


yjdT24xKtAq5