How can I avoid a full table scan on this mysql query?

后端 未结 4 2218
忘掉有多难
忘掉有多难 2021-02-15 13:00
explain
select
    *
from
    zipcode_distances z 
inner join
    venues v    
    on z.zipcode_to=v.zipcode
inner join
    events e
    on v.id=e.venue_id
where
    z.z         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-15 14:01

    You are selecting all columns from all tables (select *) so there is little point in the optimizer using an index when the query engine will then have to do a lookup from the index to the table on every single row.

提交回复
热议问题