안녕하세요 explain을 통한 쿼리 최적화 분석중 의문점이 생겨서 글을 올립니다
다음은 mysql 메뉴얼에 있는 내용입니다
ref
All rows with matching index values are read from this table for each combination of rows from the previous tables. ref is used if the join uses only a leftmost prefix of the key or if the key is not a PRIMARY KEY or UNIQUE index (in other words, if the join cannot select a single row based on the key value). If the key that is used matches only a few rows, this is a good join type.
ref can be used for indexed columns that are compared using the = or <=> operator. In the following examples, MySQL can use a ref join to process ref_table :
range
Only rows that are in a given range are retrieved, using an index to select the rows. The key column in the output row indicates which index is used. The key_len contains the longest key part that was used. The ref column is NULL for this type.
range can be used when a key column is compared to a constant using any of the = , <> , > , >= , < , <= , IS NULL , <=> , BETWEEN , or IN() operators:
여기서 range 타입의 경우 = 가 왜 포함이 되는 거지요?
= 로 비교되는 거면 위의 ref 타입과 같은게 아닌가요? |