SQL query with search conditions to filter rows [message #70148] |
Mon, 22 April 2002 02:02 |
Vidyavati
Messages: 14 Registered: April 2002
|
Junior Member |
|
|
Hi All,
Can anybody help me with the following issue...
i have 2 simple queries on a simple table...
Query 1 : SELECT Col1, Col2, Col3
FROM TABLE1
WHERE Col4='abc';
Query 2 : SELECT Col1, Col2, Col3
FROM TABLE1
WHERE Col1='123' AND Col2='546'
OR Col3='xyz' AND Col5='pqr'
OR Col6='1abc'
OR Col4='abc';
It has been observed that the execution of Query 2 takes much longer time than the execution of Query 1.
Is there any specific reason for the poor performance of Query 2 ??
Can you suggest something (rephrasing the Query 2) so that the execution time of Query 1 and Query 2 are comparable.
Thanks in advance,
With Regards,
Vidya
|
|
|
|