On Tue, Aug 21, 2012 at 9:14 AM, MB Software Solutions General Account
<[email protected]> wrote:
> On Tue, August 21, 2012 4:03 am, Dave Crozier wrote:
>> I just ran a test as I also didn't think the from was evaluated for each
>> line (why should it be?) and can categorically confirm that it makes no
>> difference whatsoever. As Stephen says, it is only evaluated once to open
>> up the table.
>
>
>
> Many thanks, Dave.  I can understand fields in the SELECT part being
> evaluated each time perhaps, but not the FROM line.
-------------------------

Once again.  The ENGINE decides how to work the data depending on the
best possible index available.

Now if you have a function in your filed list you have to process in a
table scan because it has to run each unique row.  So don't put them
in unless you have to have it.

Functions like Substring(), Replace() , IIF() all poor choices in SQL
syntax.  Great on the dataset afterwards.

The way the engine breaks down your statement:
1. From & Joins
2. Where
3. Group by
4. Field list
5. Having

Now you can see how the Index is used for #s 1-2-3.  Don't think that
the engine can substitute one index for a join and another for the
where.  It just picks the BEST one it can for the overall process.

-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmyj4obnndkmnjw4ymj798lthpxe1xyr+ayxumeut8kq...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to