MySQL advanced — Explanation of ref field in explain information

1. Explain the ref field in the Explain information
Indicates which column of the index is used, if possible, as a constant. Which columns or constants are used to find values on indexed columns
2. Explain the ref field in the information

From key_len we can see that IDX_COL1_COL2 of table T1 is fully used, that col1 matches col1 of table T2, and that col2 matches a constant, that is, the fields associated with other tables in the ‘AC’ query, and that the foreign key relationship is indexed


Read More: