Performance of MYSQL “IN”

前端 未结 2 853
说谎
说谎 2020-12-05 05:00

I\'m running a MYSQL query in two steps. First, I get a list of ids with one query, and then I retrieve the data for those ids using a second query along the lines of

2条回答
  •  抹茶落季
    2020-12-05 05:45

    Why do you extract the ids first? You should probably just join the tables. If you use the ids for something else, you can insert them in a temp table before and use this table for the join.

提交回复
热议问题