add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65781] |
Thu, 23 December 2004 02:55 |
Milind Deshpande
Messages: 93 Registered: May 2004
|
Member |
|
|
Hi Experts,
I saw this statement in one of the reply by Frank regarding one query.
How did adding 'AND 1 = 0' to the where clause speeds up the query execution. Actually, I think it should not return anything as it is an inequality condition.
Pls. let me know as I am very curious and in what situations we should add this condition to speed up the query, I mean how to identify that this condition will help.
Thanks in Advance.
Milind.
|
|
|
Re: add 'AND 1 = 0' to your where clause. That will speed things up ! [message #65783 is a reply to message #65781] |
Thu, 23 December 2004 04:00 |
Art Metzer
Messages: 2480 Registered: December 2002
|
Senior Member |
|
|
I take it you are referring to this thread. Not to put too fine a point on it, Milind, but you have "been whooshed".
By his comment,
----------------------------------------------------------------------
add 'AND 1 = 0' to your where clause. That will speed things up !
----------------------------------------------------------------------
Frank was flippantly making what is generally known as a joke.
Since Frank apparently thought that the original poster had not provided enough substantive information for Frank to diagnose the slow response time of the mystery query, Frank responded with a tongue-in-cheek answer.
You are correct, adding a predicate of AND 1 = 0 will result in no rows selected, but, you have to admit, doing so will also speed up that query's response time, however pointlessly.
I'm going to go lie down now.
|
|
|
|
|