用int做查询条件还是用Varchat做查询条件?哪个效率高?
oydj 2007-06-01 12:01:12 现在在设计一个表,将来会有上千万条数据.
里面包含的列有 id,username(varchar(16)),userid(int),title,content
请问用下面两句效率相差多少
select * from user where userid=20
select * from user where username='test'
查询条件分别是int型和varchar型,用哪个做条件去查询比较好,效率相差多少呢?