<?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: Teradata performance issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580441#M164887</link>
    <description>&lt;P&gt;To test whether a slow network is part of your problem change your query like so and compare run times:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Replace this: CREATE TABLE new AS 
Select *

With this: select count(*) as Row_Count&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Aug 2019 00:46:34 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-08-12T00:46:34Z</dc:date>
    <item>
      <title>Teradata performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580432#M164884</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been running a query on teradata, and my source table is huge- 3-4M records. the code has been running for a while now so I was wondering what can I do to make this faster. I also tried diving my source dataset into 50 groups (around 75k obs per dataset), but the first group query also took forever and&amp;nbsp;I had no other option but to terminate it. Would appreciate any suggestions.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname TD teradata user="%sysget(USER)" password="&amp;amp;pwd." tdpid=rchtera mode=ansi database=user_TD;

proc sql;
create table TD.table1 as
select *
from check; /*check is my base table*/
quit;

Proc SQL;
CONNECT TO teradata (user="%sysget(USER)" password="&amp;amp;pwd." tdpid=rchtera mode=teradata); 

CREATE TABLE new AS 
Select *
From connection to teradata
	(SELECT abc.data1,
			                CAST(abc.data2 AS CHAR(19))  AS data2
							, abc.data3
				from		user_TD.table1 AS table
				left join 	[teradata table]			abc		on	table.data2 = data2 
				where abc.data1 not in (select data1 from table)
and data2 in (select data2 from table));
DISCONNECT FROM TERADATA;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Aug 2019 21:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580432#M164884</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-08-11T21:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Teradata performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580441#M164887</link>
      <description>&lt;P&gt;To test whether a slow network is part of your problem change your query like so and compare run times:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Replace this: CREATE TABLE new AS 
Select *

With this: select count(*) as Row_Count&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 00:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580441#M164887</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-08-12T00:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Teradata performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580449#M164893</link>
      <description>&lt;P&gt;1. in() clauses can be much slower than joins, depending how the optimiser does its job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. I am unsure of the purpose of this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;CODE class="  language-sas"&gt;and data2 &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; data2 &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 03:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-performance-issue/m-p/580449#M164893</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-12T03:35:19Z</dc:date>
    </item>
  </channel>
</rss>

