hi - Lets say I am processing a vast number of groups of 10 records to identify which of them 'survive' a series of restrictions. My WHERE statement might look something like...
WHERE (T.A + T.B/2 > T.C) AND
(T.A / T.B <> T.D) AND
(T.X < 1000) AND
... many more restrictions ...
Now, the 1st restriction rejects ~99% of the groups that will eventually be rejected, and the other 35+ restrictions reject only a few more.
I want to know how SQL deals with this WHERE statement. If the group fails the 1st constraint, does SQL still grind through all of the other constraints? If so, I'd probably want to use 2 queries - one to handle only the 1st constraint, and another to subject the 'survivors' to all of the other constraints. Any thoughts?
Thanks - Vicky
WHERE (T.A + T.B/2 > T.C) AND
(T.A / T.B <> T.D) AND
(T.X < 1000) AND
... many more restrictions ...
Now, the 1st restriction rejects ~99% of the groups that will eventually be rejected, and the other 35+ restrictions reject only a few more.
I want to know how SQL deals with this WHERE statement. If the group fails the 1st constraint, does SQL still grind through all of the other constraints? If so, I'd probably want to use 2 queries - one to handle only the 1st constraint, and another to subject the 'survivors' to all of the other constraints. Any thoughts?
Thanks - Vicky