Table 1 is a SQL Server table registered metadata in SAS - 100 million rows
SQL Server database {using ODBC connection implicit query not expicit pass thru}
SAS PROC SQL query fetches these 100 million rows in 4 minutes
Processing time - 4 minutes
Table 2 is a SAS dataset having the same data as above SQL Server table = 100 million rows
Same query when used to fetch data from this SAS dataset it takes 1 hour.
Processing time - 1 hour
Both queries are same.
I cannot see the indexes on the SQL Server table.
Why fetching the data from SAS internal datasets takes longer than fetching from SQL Server?
I'm not too sure about the configuration of the SQL Server box but we access it using ODBC connection using a libname.
Example:
SQL Server Query
==============
proc sql;
create table A as
select
var1
,var2
,var3
from SQLLIB.SQL_table1
where var_X = 'XXX'
and var_Y = 'YYY'
and var_Z = 'ZZZ'
;
quit;
SAS Dataset Query
==============
proc sql;
create table A as
select
var1
,var2
,var3
from SASLIB.SAS_table1
where var_X = 'XXX'
and var_Y = 'YYY'
and var_Z = 'ZZZ'
;
quit;
I will try using the options you suggested
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.