<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS performance in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/601047#M173816</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, my bad. But I could figure it out myself. So below is the sample query. So when I run this on Teradata, it runs in 40 sec whereas on SAS it took 8 minutes. From TD logs, I see that the only SELECT from proc sql runs on TD , SAS then brings back the data set and creates the table on it's work space which is why it takes 8 minutes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query : 1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;drop table work.table1;&lt;/P&gt;&lt;P&gt;create table work.table1 as&lt;/P&gt;&lt;P&gt;select * from trlib.Employee t1&lt;/P&gt;&lt;P&gt;inner join&lt;/P&gt;&lt;P&gt;trlib.Salary t2&lt;/P&gt;&lt;P&gt;on t1.empid = t2.empid&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I then figured there is a way to directly run the whole thing on Teradata (in it's spool space )and create the table on TD itself and then bring back the results on SAS for further processing /analysis. The same query actually ran in 30 sec from SAS as opposed to 8 mins when run on SAS work space.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;connect to teradata (user="john" server="apple" pw="test123" mode="teradata" );&lt;/P&gt;&lt;P&gt;execute (create table as select * from …. ) by teradata;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2019 18:33:15 GMT</pubDate>
    <dc:creator>RupaJ</dc:creator>
    <dc:date>2019-11-01T18:33:15Z</dc:date>
    <item>
      <title>SAS performance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/598816#M172728</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run a query (with PROC SQL accessing Teradata) on SAS and the same query I am executing on Teradata database directly. On Teradata database, the query runs in seconds, however on SAS it is running for more than 20 minutes. I am wondering how SAS is processing the request. If everything is happening on the Teradata side and if SAS is just bringing the results, why would it take this long.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now both Teradata and SAS has around 1 TB work space for query processing.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 19:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/598816#M172728</guid>
      <dc:creator>RupaJ</dc:creator>
      <dc:date>2019-10-23T19:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS performance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/598827#M172733</link>
      <description>&lt;P&gt;It's impossible to answer without knowing the query.&lt;/P&gt;
&lt;P&gt;Implicit or explicit pass-through? Any functions used? etc.&lt;/P&gt;
&lt;P&gt;Do you know about the SASTRACE option, which can show you the query sent to Teradata?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 20:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/598827#M172733</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-10-23T20:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS performance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/601047#M173816</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, my bad. But I could figure it out myself. So below is the sample query. So when I run this on Teradata, it runs in 40 sec whereas on SAS it took 8 minutes. From TD logs, I see that the only SELECT from proc sql runs on TD , SAS then brings back the data set and creates the table on it's work space which is why it takes 8 minutes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query : 1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;drop table work.table1;&lt;/P&gt;&lt;P&gt;create table work.table1 as&lt;/P&gt;&lt;P&gt;select * from trlib.Employee t1&lt;/P&gt;&lt;P&gt;inner join&lt;/P&gt;&lt;P&gt;trlib.Salary t2&lt;/P&gt;&lt;P&gt;on t1.empid = t2.empid&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I then figured there is a way to directly run the whole thing on Teradata (in it's spool space )and create the table on TD itself and then bring back the results on SAS for further processing /analysis. The same query actually ran in 30 sec from SAS as opposed to 8 mins when run on SAS work space.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;connect to teradata (user="john" server="apple" pw="test123" mode="teradata" );&lt;/P&gt;&lt;P&gt;execute (create table as select * from …. ) by teradata;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 18:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/601047#M173816</guid>
      <dc:creator>RupaJ</dc:creator>
      <dc:date>2019-11-01T18:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS performance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/601109#M173827</link>
      <description>&lt;P&gt;1. There is no reason whatsoever that the query you describe should run in SAS when it can run in Teradata.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table work.table1 as
select * from teralib.Employee t1
inner join
teralib.Salary t2
on t1.empid = t2.empid;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should run exactly the same as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect using TERALIB;
create table work.table1 as
select * from connection to TERALIB 
 (select * from Employee t1
  inner join
  Salary t2
  on t1.empid = t2.empid);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it doesn't you should contact tech support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. This:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;execute (create table as select * from …. ) by teradata;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;creates a teradata table, not a SAS table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 22:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-performance/m-p/601109#M173827</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-01T22:01:00Z</dc:date>
    </item>
  </channel>
</rss>

