同一个sql语句,当改变条件中的值时查询速度慢了好几十倍,只是为什么?
对一个视图做查询 ,sql语句简单描述如下:
select field1,field2,…… from view_tb where condition1 and rtype = '1' 执行时间 0.01秒
select field1,field2,…… from view_tb where condition1 and rtype = '2' 执行时间 21秒
这是为什么? 有没有那位遇见过同样的问题,希望能交流一下。
谢谢!