1.select * from [table] 2.select * from [table] where id=1 and [name]=abc and ...上面两句的执行速度那个快些?另一个就是
3.select * from [table] where id=.. (id整型)4.select * from [table] where [name]=... (name字符型)4.select * from [table] where [id]=... and [name]=...当我同时知道ID和NAME的查询条件时,3,4两个比较那个好?5是最好的么?
最好能说的细些。不过没分。不好意思。谢谢
3.select * from [table] where id=.. (id整型)4.select * from [table] where [name]=... (name字符型)4.select * from [table] where [id]=... and [name]=...当我同时知道ID和NAME的查询条件时,3,4两个比较那个好?5是最好的么?
最好能说的细些。不过没分。不好意思。谢谢
打字也花时间...统计语句..用以下是测试语句效率的
SET SHOWPLAN_ALLSET SHOWPLAN_TEXTSET STATISTICS IO
SET STATISTICS TIME
----------------------------------------------
相较,3好。id 整型
那么3和5
一个得到9999999条记录,一个得到3条记录是产生数据集的过程费时呢? 得到数据集的呈现费时?呵呵,这个我也说不好.
两个实现的根本就不是同样的业务逻辑.
否则,1、2都要遍历表,但2要进行组织输出的数据量会少得多,因此也要快些。
select * from table和select * from table where 条件
这个有比较意义吗?记录数都不一定一样?