How to improve this MySQL Query using join?

后端 未结 3 1145
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 18:53

I have got a simple query and it takes more than 14 seconds.

select 
     e.title, e.date, v.name, v.city, v.region, v.country

from seminar e force index for jo         


        
3条回答
  •  长情又很酷
    2021-01-21 19:54

    I went another way since it seems that MySQL can't handle joins effectively:

    • Created one big new table with all the columns I need from the join
    • So the seminars and events are in one table now
    • added indexes

    Now the query is fast. Don't know why...

    From 25 seconds, we are down to .08 seconds

    That's how I wanted it.

    If anybody still knows why, you are more than welcome to provide an answer.

提交回复
热议问题