Archive

Archive for October, 2010

mysql给同一个表添加多个索引的测试

October 25th, 2010 No comments

分别给xc表添加ind_name和ind_status的索引:

root@test 11:44:13>create index ind_name on xc(name);
Query OK, 6815744 rows affected (1 min 43.75 sec)
Record[……]

Read more

Categories: database, mysql Tags:

记一次not in 和 minus的优化

October 11th, 2010 No comments

优化前:
select count(t.id)
  from test t
 where t.status = 1
   and t.id not in (select distinct a.app_id
                      from test2 a
      [……]

Read more

Categories: database, sql优化 Tags: