The most important things are order of the where clause and indeed the 
indexes which are set.

If this query is done very frequently you could think of using indexes on 
all the fields you are joining on.


----- Original Message ----- 
From: "Paul Robinson" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, April 09, 2005 10:27 AM
Subject: [AspClassicAnyQuestionIsOk] Importance of field order in SQL SELECT 
statement


>
> Hi,
> Can anyone advise whether there is any significance in the order of field 
> selection in a SQL SELECT statement
> I understand that it is better to have the most restrictive joins first, 
> but what I want to know is whether the order of field selection makes any 
> difference.
> For instance,  I am joining tblProjectData to xProjectStatus and 
> tblPersonnel and tblLocation and I want to select fields from each of 
> these tables. Should my select statement call the fields in the order of 
> the joins? Would it matter if I select fields from each table in turn and 
> then at the end select a field from the first table in the join structure?
> The reason I am asking is because I am calling a recordset that queries 10 
> tables. I use the .getrows method to create an array and then show the 
> data in a table referencing the array by index numbers. My client now 
> wants to add a further column to the table. I can easily add the field to 
> the end of the SQL and reference its index. However, this recordset is 
> growing at a substantial rate and I need to make sure my SQL is efficient. 
> Should I reorder my SQL statement and change the indexes now.
> Thanks for any help
> Paul
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.3 - Release Date: 4/5/2005
>
> 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to