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
Have indexed the columns in both tables?
e.id and v.venue_id
If you do not, creates indexes in both tables. If you already have, it could be that you have few records in one or more tables and analyzer detects that it is more efficient to perform a full scan rather than an indexed read.