Hello Experts,
I have a scenario where I need to compare multiple fields using the like operator in a SP and the input can have the wild card operator '%' or it might not have it , in either case I use the LIKE operator (like input_variable) in SQL.
I would like to know if using the LIKE operator without the wildcard operator would be as efficient as using the equal operator.
For example the following two queries return same result.
But for DB2 and would they be translated into same Access Path , I mean would they be same efficiency wise or would the equal operator be more efficient.
I would like to know how DB2 implements this internally.
Thanks in advance.
I have a scenario where I need to compare multiple fields using the like operator in a SP and the input can have the wild card operator '%' or it might not have it , in either case I use the LIKE operator (like input_variable) in SQL.
I would like to know if using the LIKE operator without the wildcard operator would be as efficient as using the equal operator.
For example the following two queries return same result.
Code:
select * from S where s.name like 'somename';
select * from S where s.name='somename';
I would like to know how DB2 implements this internally.
Thanks in advance.