Hello,

I am calling a complex query through ADO code that takes approximately 70 seconds to complete:

Code:
Dim lIndexGx As Long
    Dim arrGx
    sSQL = "SELECT DEV.Dt AS Dt, tblGx.GID AS GID, IIf(tblOutages!GID Is Null,Installed_Capacity,0) AS Actual_Capacity, tblGx.ZoneID AS ZoneID " & _
            "FROM (SELECT tblDt.Dt, tblGx.GID, tblGx!Installed_Capacity*(1-tblGx![EFOR(%)]/100) AS Installed_Capacity,  tblGx.Cost, tblGx.ZoneID FROM tblDt, tblGx " & _
            "WHERE Dt BETWEEN #" & sStartDate & "# And #" & sEndDate & "# AND tblGx.ResID <> 1 AND tblGx.ResID <> 8 AND  tblGx.ResID <> 2 " & _
            "UNION SELECT tblDt.Dt, tblGx.GID, tblHydroProfiles.Capacity, tblGx.Cost, tblGx.ZoneID " & _
            "FROM tblGx INNER JOIN (tblDt INNER JOIN tblHydroProfiles ON (tblDt.Hour=tblHydroProfiles.Hour) AND (tblDt.DOW=tblHydroProfiles.DOW) AND (tblDt.Month=tblHydroProfiles.Month)) ON tblGx.ProfileID=tblHydroProfiles.HydroProfileID " & _
            "WHERE (((tblGx.InServiceDate)<=tblDt!Dt) And ((tblGx.OutServiceDate)>tblDt!Dt)) AND tblDt.Dt BETWEEN #" & sStartDate & "# And #" & sEndDate & "# " & _
            "UNION SELECT " & _
            "tblDt.Dt , tblGx.GID, tblGx.Installed_Capacity * tblWindProfile.CapFac, tblGx.Cost, tblGx.ZoneID " & _
            "FROM tblDt INNER JOIN (tblGx INNER JOIN tblWindProfile ON tblGx.ProfileID=tblWindProfile.WindProfileID) ON (tblDt.Month=tblWindProfile.Month) AND (tblDt.Hour=tblWindProfile.Hour) " & _
            "WHERE (((tblGx.InServiceDate)<=tblDt!Dt) And ((tblGx.OutServiceDate)>tblDt!Dt)) AND " & _
            "tblDt.Dt BETWEEN #" & sStartDate & "# And #" & sEndDate & "# " & _
            ") AS DEV LEFT JOIN tblOutages ON (DEV.Dt <= tblOutages.EndDate) AND (DEV.Dt >= tblOutages.StartDate) AND (DEV.GID = tblOutages.GID) " & _
            "ORDER BY Dt, Cost;"

    adoRs.Open Source:=sSQL, _
        ActiveConnection:=adoConn
    arrGx = adoRs.GetRows
    lIndexGx = 0
    adoRs.Close
    Set adoRs = Nothing
It returns a 2.3 million record recordset.

My questions are twofold:
1. If there is any way to optimize the query to run faster
2. If I should be using .GetRows, or if it would be faster and/or more memory efficient to loop through the recordset using .MoveNext

Thanks