11/22/20

How does range condition effects the performance ?

---------------------------------------------------------------

 

One of the select query is taking more time and the application changed the following 

 id <=2  to  id < 3

 

 select * from table where id <=2       --- original query 

 select * from table where id < 3        ---- new query , taking longer

 

 both queries are using the index range scan i.e. same execution plan

 

 both queries are semantically same and provides the same results but for true oltp systems it makes different.

 

 for new query we are seeing more buffer gets than the old query

 

 i.e. for new query buffer gets reduced dramatically, so we opened the sr with oracle and they provided following possible reason

 

 id <=2 will scan the less number of blocks than the id < 3


:-) 

No comments:

Post a Comment