What does eq_ref and ref types mean in MySQL explain

后端 未结 2 1213
鱼传尺愫
鱼传尺愫 2021-02-01 18:12

When we prefix an SQL query with the keyword \"explain\" we get a table with some columns. Please tell me what is the \"type\" column. What does eq_ref and re

2条回答
  •  星月不相逢
    2021-02-01 18:30

    The "type" refers to the join type made in your request. From best to worst, here is the list :

    • system
    • const
    • eq_ref
    • ref
    • range
    • index
    • all

    You will find a more detailed explanation at the MySQL documentation : http://dev.mysql.com/doc/refman/5.0/en/explain-output.html

提交回复
热议问题