How do you understand ref in MySQL?

The usage of

explain says that ref shows which column or constant to use with key to select rows from the table.
this sentence is not understood.

Note: this ref is not the ref in type.

Mar.12,2021

recently I have also been looking at explain
. I think the ref column indicates which fields in the table have gone to the index (if the index is a primary key or a unique index, it will show that const), finally selected the data (select row, row data)


https://dev.mysql.com/doc/ref.

The ref column shows which columns or constants are compared to the index named in the key column to select rows from the table.
The

key column is the actual index used. However, index may be based on several columns of the data table. The ref column lists which columns or constants are used.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b42776-2c5f8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b42776-2c5f8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?