SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 44069: Performance might be affected if your query joins multiple tables or views in which variables are being renamed

DetailsHotfixAboutRate It

Performance problems might occur when you process a query in which you rename a variable and then use that renamed variable later in your query in a subquery.

In the following code example, two views that contain the same variable names are created. In the view work.v3, the two preceding views are joined and one of the common variables is renamed so that both instances of the variable VAR3 could be kept. In the work.final query, the new variable name is used in the subquery. Rather than referencing the new name, the query being passed to the database references the original variable name. This results in a syntax error from the database. SAS retrieves the data for each of the tables that make up the query and proceeds to process the query within SAS®. As a result, the query might take longer to run than if it had been processed by the database.

proc sql; create view work.v1 as select B2.var1 , B2.var2, H2.var3 from DBMSLIB.mba1 as B2 inner join DBMSLIB.mba2 as H2 on B2.var1 = H2.var6 ; create view work.v2 as select B1.var1 , B1.var2 , H1.var3 from DBMSLIB.mba1 as B1 inner join DBMSLIB.mba2 as H1 on B1.var2 = H1.var6; create view work.v3 as select v2.var3 as v2 , v1.var3 as v1 from work.v1 inner join work.v2 on v1.var1 = v2.var1 and v1.var2 = v2.var2; create table work.final as select v3.v2 , v3.v1 from work.v3 where NOT EXISTS (select 1 as dummy from DBMSLIB.mba3 as L1 where L1.var7 = v3.v2 and L1.var8 = v3.v1 ) ; quit ;

Click the Hot Fix tab in this note to access the hot fix for this issue.

Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASz/OS9.1 TS1M3 SP49.4 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows XP 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows 2000 Advanced Server9.1 TS1M3 SP4
Microsoft Windows 2000 Datacenter Server9.1 TS1M3 SP4
Microsoft Windows 2000 Server9.1 TS1M3 SP4
Microsoft Windows 2000 Professional9.1 TS1M3 SP4
Microsoft Windows NT Workstation9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Standard Edition9.1 TS1M3 SP4
Microsoft Windows XP Professional9.1 TS1M3 SP4
Windows Vista9.1 TS1M3 SP4
Windows Vista for x649.1 TS1M3 SP4
64-bit Enabled AIX9.1 TS1M3 SP49.4 TS1M0
64-bit Enabled HP-UX9.1 TS1M3 SP49.4 TS1M0
64-bit Enabled Solaris9.1 TS1M3 SP49.4 TS1M0
HP-UX IPF9.1 TS1M3 SP4
Linux9.1 TS1M3 SP4
Linux on Itanium9.1 TS1M3 SP4
OpenVMS Alpha9.1 TS1M3 SP4
Solaris for x649.1 TS1M3 SP49.4 TS1M0
Tru64 UNIX9.1 TS1M3 SP49.4 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.