sql如下 如果不加最后一个条件and b.tzlx_dm = '00' 执行的非常快,但是如果加上之后 执行很长时间没有反应,具体的执行计划在下面,第一个没有 b.tzlx_dm = '00' 条件的(快)。 第二个有 b.tzlx_dm = '00' 条件的(慢)。
请教大神们的帮助,谢谢
SELECT nsr.nsrsbh, nsr.nsrmc, nsr.djxh, nsr.nsrzt_dm, nsr.djzclx_dm, nsr.zgswj_dm, '0' as zgxtbz
FROM db_zgxt.t_dj_jgnsr a,
db_zgxt.t_zs_yzmx b,
dm_gy_zsxmpm d,
dj_nsrxx nsr
where a.nsrnbm = b.nsrnbm
and a.nsrbm = nsr.nsrbm
and b.zsxm_dm = d.old_dm
and b.zspm_dm = d.old_dm1
and b.zf_bj = '0'
and b.ykp_bj = '0'
and b.yzsf_je > 0
-- and b.tzlx_dm = '00'
无 b.tzlx_dm = '00' 条件 快
有 b.tzlx_dm = '00' 条件 慢