title: Is there any performance difference between these 3 queries
body: <p>I have two tables <code>t1</code> and <code>t2</code> as below:</p>
  <pre><code>create table t1(
    id int primary key,
    name varchar(10),
    desc varchar(500)
  );
  
  create table t2(
    id int primary key,
    tid int foreign key references t1(id),
    code varchar(10)
  );
  </code></pre>
  <p>Now I want to query some data from <code>t1</code> where it has related record in <code>t2</code>,so I wrote the following three queries:</p>
  <pre><code>-- query1,using in with hard code inside it,n might be more than 100
  SELECT * FROM t1 WHERE id IN(tid1,tid2,....tidn);
  
  -- query2,using in with subquery 
  SELECT * FROM t1 WHERE id IN(SELECT tid FROM t2);
  
  -- query3,using join
  SELECT t1.* FROM t1 JOIN t2 ON t1.id=t2.tid;
  </code></pre>
  <p>Now I am wondering which one has the best query performance,suppose the version of <code>MySQL</code> is <strong>5.1</strong>(also is it has something to do with the version?),
  thanks in advance!</p>
  <p>I have tested it myself,and I found it with something to do with the data size,different size will give different result,so I ask it here</p>