<?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 Proc SQL Query Tuning - Running 6 hours in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-Tuning-Running-6-hours/m-p/741893#M231990</link>
    <description>&lt;P&gt;The below query takes 6 hours to run. Can any one help with tuning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options nocenter compress=yes;&lt;BR /&gt;libname lib 'path';&lt;/P&gt;&lt;P&gt;%libkrb5(uwork,teradata,dbname);&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;%krb5(rchtera);&lt;BR /&gt;execute (collect statistics on teradata.table1 index (p1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table1 column (p1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table2 index (o1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table2 column (o1)) by teradata;&lt;BR /&gt;create table lib.t1 (bufsize=1073741824 bufno=max) as /*t1 has195395189 rows and 7 columns*/&lt;BR /&gt;select * from connection to teradata(&lt;BR /&gt;select distinct a.p1&lt;BR /&gt;,b.o1&lt;BR /&gt;,c.c1&lt;BR /&gt;,c.c2&lt;BR /&gt;,c.c3&lt;BR /&gt;,c.c4&lt;BR /&gt;,c.c5&lt;BR /&gt;from teradata.table1 a&amp;nbsp;/* has 21371007 rows and 51 columns */&lt;BR /&gt;,vbmr.pty_ofr_dtl b&lt;BR /&gt;,teradata.table2 c&amp;nbsp; /* has&amp;nbsp;198 rows and 9 column */&lt;BR /&gt;where a.p1 = b.p1&lt;BR /&gt;and b.o1 = c.o1&lt;BR /&gt;and b.o2 = '9999-12-31'&lt;BR /&gt;and b.o3 = 1&lt;BR /&gt;and b.o4 = 0&lt;BR /&gt;and b.o5 = 0&lt;BR /&gt;);&lt;BR /&gt;disconnect from teradata;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Mon, 17 May 2021 15:41:43 GMT</pubDate>
    <dc:creator>Yen</dc:creator>
    <dc:date>2021-05-17T15:41:43Z</dc:date>
    <item>
      <title>Proc SQL Query Tuning - Running 6 hours</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-Tuning-Running-6-hours/m-p/741893#M231990</link>
      <description>&lt;P&gt;The below query takes 6 hours to run. Can any one help with tuning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options nocenter compress=yes;&lt;BR /&gt;libname lib 'path';&lt;/P&gt;&lt;P&gt;%libkrb5(uwork,teradata,dbname);&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;%krb5(rchtera);&lt;BR /&gt;execute (collect statistics on teradata.table1 index (p1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table1 column (p1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table2 index (o1)) by teradata;&lt;BR /&gt;execute (collect statistics on teradata.table2 column (o1)) by teradata;&lt;BR /&gt;create table lib.t1 (bufsize=1073741824 bufno=max) as /*t1 has195395189 rows and 7 columns*/&lt;BR /&gt;select * from connection to teradata(&lt;BR /&gt;select distinct a.p1&lt;BR /&gt;,b.o1&lt;BR /&gt;,c.c1&lt;BR /&gt;,c.c2&lt;BR /&gt;,c.c3&lt;BR /&gt;,c.c4&lt;BR /&gt;,c.c5&lt;BR /&gt;from teradata.table1 a&amp;nbsp;/* has 21371007 rows and 51 columns */&lt;BR /&gt;,vbmr.pty_ofr_dtl b&lt;BR /&gt;,teradata.table2 c&amp;nbsp; /* has&amp;nbsp;198 rows and 9 column */&lt;BR /&gt;where a.p1 = b.p1&lt;BR /&gt;and b.o1 = c.o1&lt;BR /&gt;and b.o2 = '9999-12-31'&lt;BR /&gt;and b.o3 = 1&lt;BR /&gt;and b.o4 = 0&lt;BR /&gt;and b.o5 = 0&lt;BR /&gt;);&lt;BR /&gt;disconnect from teradata;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 15:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-Tuning-Running-6-hours/m-p/741893#M231990</guid>
      <dc:creator>Yen</dc:creator>
      <dc:date>2021-05-17T15:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Query Tuning - Running 6 hours</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-Tuning-Running-6-hours/m-p/741899#M231995</link>
      <description>As all this happens in and from Teradata, there's two options:&lt;BR /&gt;- the Teradata actions and query take so long&lt;BR /&gt;- your network is the bottleneck in fetching the result</description>
      <pubDate>Mon, 17 May 2021 15:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-Tuning-Running-6-hours/m-p/741899#M231995</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-17T15:54:00Z</dc:date>
    </item>
  </channel>
</rss>

