I am working out on tunining a particular query using Explain. While analyzing I came across small query regarding Explain. Below I have given two similar queries. Can you please tell me whether Explain will give different results as far as cost/time required is concerned in case of below queries.
1. Select * from Employee_database where Emp_id = 12345;
2. Select * from Employee_database where emp_id = 111111111;
Actually I am looking for difference between explains on above two queries. I would like to know whether cost shown by Explain will be differerent or same in above case. In short, whether Explain consider the values given in condition or it is independent of vlaue and just takes predicates.
Yeah.. thanks.. Even I think the actual processing time will be different depending upon the system performance, values to be passed in the condition etc.
In case of above two queries, suppose, we are lookling for records which is not present in the table. Then DB2 will require more time compared to if record is present. I believe while running Explain, these things are not considered as query is not actually executed. I just wanted to confirm this.