sql语句性能问题(1)select b.x_Client_Satisfaction from siebel.s_srv_req a,siebel.s_Srv_Req_x bwhere a.row_id = b.par_row_idand a.created > to_date('2013-11-20 00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24and b.x_Client_Satisfaction is not null;(

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 02:35:59

sql语句性能问题(1)select b.x_Client_Satisfaction from siebel.s_srv_req a,siebel.s_Srv_Req_x bwhere a.row_id = b.par_row_idand a.created > to_date('2013-11-20 00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24and b.x_Client_Satisfaction is not null;(
sql语句性能问题
(1)select b.x_Client_Satisfaction from siebel.s_srv_req
a,siebel.s_Srv_Req_x b
where a.row_id = b.par_row_id
and a.created > to_date('2013-11-20
00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24
and b.x_Client_Satisfaction is not null;
(2)select b.x_Client_Satisfaction from siebel.s_srv_req
a,siebel.s_Srv_Req_x b
where a.row_id = b.par_row_id
and a.created > to_date(to_char(sysdate,'yyyy-mm-dd')||'00:00:00','yyyy-mm-dd
hh24:mi:ss')-8/24
and b.x_Client_Satisfaction is not null;
这两个语句中加了限制时间的条,数据量很大时第二个语句跑不动,第一个还行,这是为什么?

sql语句性能问题(1)select b.x_Client_Satisfaction from siebel.s_srv_req a,siebel.s_Srv_Req_x bwhere a.row_id = b.par_row_idand a.created > to_date('2013-11-20 00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24and b.x_Client_Satisfaction is not null;(
这里的主要区别就是第二个语句用了sysdate函数取系统时间,这里看来是将这个值作为变量处理了.
第一个语句优化器是将 to_date('2013-11-20 00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24直接处理好后作为常量执行语句,所以索引等都能够使用
第二个语句优化器to_date(to_char(sysdate,'yyyy-mm-dd')||'00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24作为变量处理的话,就不会走created的索引,所以变成表扫描的话就会比较慢.

sql语句性能问题(1)select b.x_Client_Satisfaction from siebel.s_srv_req a,siebel.s_Srv_Req_x bwhere a.row_id = b.par_row_idand a.created > to_date('2013-11-20 00:00:00','yyyy-mm-dd hh24:mi:ss')-8/24and b.x_Client_Satisfaction is not null;( SQL 语句 SELECT * FROM {{table}} WHERE `fleet_end_time` sql语句 后面的(+) select * from t1,t2 where t1.a=t2.b(+) SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据 关于sql语句的问题 where a.line_code=b.line_code(+) ,(+)是怎么回事 ,具体点 ,最好有例句select a.line_code,b.line_code,b.line_name,a.measure_id,a.measure_name,a.measure_type from measure_cell a,line_base b where a.line_code=b.lin sql 语句中 select * from table where 2=1 的where2=1有什么意思和作用 sql语句and 1=1是什么意思?select a.ename, a.mgr, a.sal, b.deptnofrom emp a, dept bwhere a.deptno = b.deptnoand b.deptno in ('ACCOUNTING', 'RESEARCH', 'SALES', 'OPERATIONS')AND 1=1; 这句sql语句怎么改成left join的select 表2.a as a,表2.a as b,表2.a as c from 表1 a,表2 b,表2 c,表3 dwhere a.条件(+)=b.条件and a.条件(+)=c.条件and d.条件(+)=c.条件可能写错了,应该是这样的,抱歉select 这句sql语句怎么改成left join的select 表2.a as a,表2.a as b,表3.a as c from 表1 a,表2 b,表2 c,表3 dwhere a.条件(+)=b.条件and a.条件(+)=c.条件and d.条件(+)=c.条件可能写错了,应该是这样的,抱歉select sql语句中参数乘法select top 4 *from UserInfowhere ID not in(select top 12 idfrom UserInfo ) 这个语句里面 12 用 3*4表示该怎么写啊4是第一个参数 3是第二个参数 ‘{0}‘ * (‘{1}’-1)这么写不对啊我这 sql里,where a in (select .) and b in (select .)这种表示合法吗? SQL语句当中类似“where reserved3&1 = 比如select * from A where reserved3&1 = 其中的&又是啥意思呢 请问以下的SQL语句表示什么意思?select round(630.67,1),round(630.67,-2),round(630.67,-3),round(630.67,0);其中的1,-2,-3, select-sql 语句中,筛选用(?)子句,分组用group by 子句,排序用order by 子句上述括号中筛选用什么子句? 在SELECT-SQL语句的ORDER BY子句中,DESC表示按什么输出 sql语句中SELECT后面*表示什么什么时候用,举个列子 SQL的SELECT语句有哪几部分构成?,作用分别是什么?,如何利用它们表达查询要求? oracle sql语句获取前两条数据select id,seq from hzds_admin where seq