SQL语句优化(雷人代码)
维护组项目出了点问题,打开网站越慢,部门几个老员工在找原因,发现一条SQL语句,我看到没把我雷死。 原代码: 代码 1 select top 16 goods_id,goods_name,goods_thumb,integral,cat_id from 2 goods where goods_id > 0 and cat_id = 40 and is_real = 1 and area in ( ' 000 ' , ' 0514 ' ) 3 AND goods_name not like ' %B30(2G)纽曼MP3% ' and goods_name not like ' %IPOD音箱% ' 4 and goods_name not like ' %SP-8210 史努比旋风吹风机% ' and goods_name not like ' %zippo打火机150ZL% ' 5 and goods_name not like ' %ZIPPO打火机205% ' and goods_name not like ' %zippo打火机280AW陆军空战银章% ' 6 and goods_name not like ' %爱国者音箱SP-F021% ' and goods_name not like ' %爱国者音箱SP-F027% ' 7 and goods_name not