Which MySQL JOIN query is more efficient?

后端 未结 4 637
谎友^
谎友^ 2021-02-03 16:01

Given the following table structure:

CREATE TABLE user (
   uid INT(11) auto_increment,
   name VARCHAR(200),
   PRIMARY KEY(uid)
);
CREATE TABLE user_profile(
          


        
4条回答
  •  清酒与你
    2021-02-03 16:16

    The answer usually depends on the statistics gathered by database. The first form seems to be easier for optimizer.

    As far as I remember, MySQL doesn't work well with IN... queries and subselects

提交回复
热议问题