"...I have been told before by several people, and I have implemented myself on several SQLs that adding the clause "AND 1=1" literally to any SQL statement helps improve the performance of the SQL statement dramatically."
And we've all been wasting our time looking for a FAST=TRUE parameter.
7 comments:
imagine my surprise when one candidate exclaimed "We never use joins, always exists. Our DBA worked at Oracle and he's the expert."
You can use (1=0) only if your table is empty.
If the table is full you will get check constraint violated, since no row will meet that criteria.
What check constraint?
I've always wondered how I can check when a table is "full". Now I know I just have to "add 1=0" and see if it violates the "check constraint".
Uh, sorry fellas, but no that won't happen at all. Using 1=0 forces a full table scan.
What won't happen?
Sometimes the comments are more WTF than the original post...
Post a Comment