<?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: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308720#M66282</link>
    <description>&lt;PRE&gt;
You can use IN operator too.

select *
 from tera 
  where id in (select id form sas);


OR Hash Table.
&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Nov 2016 11:20:49 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-11-02T11:20:49Z</dc:date>
    <item>
      <title>Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308657#M66254</link>
      <description>&lt;P&gt;I have a teradata table with 1.5 billion rows of data. I need to filter this table on 1+ million account numbers, so I can only get those rows from the teradata table. The second table containing only the account numbers is in SAS locally obtained from a totally different DW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought of using "intersect", but the issue is that the&amp;nbsp;first table has several columns, and the second table got only one column containing account numbers, so it won't work. Then I thought of adding all account numbers into a macro and pass that in the explicit passthrough. But then the macro values will go beyond 32,767 character limit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems I have to use implicit passthrough, but I want this to be done quick not taking hours.&lt;/P&gt;
&lt;P&gt;Is there any other ways this can be accomplished within a matter of minutes vs. hours?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308657#M66254</guid>
      <dc:creator>Venkat4</dc:creator>
      <dc:date>2016-11-02T03:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308659#M66256</link>
      <description>&lt;P&gt;Load your SAS table into Teradata as a temporary table and do the join there.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308659#M66256</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-02T03:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308660#M66257</link>
      <description>&lt;P&gt;Thanks, I forgot to mention the teradata got only read access, no write access to this production db. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308660#M66257</guid>
      <dc:creator>Venkat4</dc:creator>
      <dc:date>2016-11-02T04:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308661#M66258</link>
      <description>&lt;P&gt;Most databases have special temporary space just for this purpose:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0irpkyp22l7vzn1il9lx6f4wmx9.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0irpkyp22l7vzn1il9lx6f4wmx9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check with your Teradata DBA to see if you can have access to this. This is the most efficient method - any other cross-database technique will be extremely slow.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308661#M66258</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-02T04:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308720#M66282</link>
      <description>&lt;PRE&gt;
You can use IN operator too.

select *
 from tera 
  where id in (select id form sas);


OR Hash Table.
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 11:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308720#M66282</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-02T11:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308755#M66301</link>
      <description>Sorry &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, those are not very good ways to so it. The result is that all 1.5 billion rows are transferred to the local SAS session. &lt;BR /&gt;TD temporary table should be the way to evaluate first.</description>
      <pubDate>Wed, 02 Nov 2016 14:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308755#M66301</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-02T14:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308757#M66302</link>
      <description>&lt;P&gt;Thanks to both. I already tried that in clause using implicit passthrough like you stated, but it didn't finish and I fed up of it, then stopped. We do have write access to a different database within teradata, so I think I will load the 1+mil account numbers into a teradata db that we have access to write, then use that in the in clause filter via explicit passthrough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't know about the temporary table space - but that is a good info. Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308757#M66302</guid>
      <dc:creator>Venkat4</dc:creator>
      <dc:date>2016-11-02T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308789#M66314</link>
      <description>I think that if upload to a temp table you should be able to use implicit pass through.</description>
      <pubDate>Wed, 02 Nov 2016 17:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308789#M66314</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-02T17:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need to filter a 1.5 billion rows teradata table with 1 mil account numbers from a sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308868#M66349</link>
      <description>&lt;P&gt;To speed up the database access use&amp;nbsp;EXISTS statement in SQL rather than the IN statement&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; *&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; table_a a&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;exists&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;*&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; orders o&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; a.prod_id=o.prod_id);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;It is best to write a SQL statement with subquery.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 19:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-filter-a-1-5-billion-rows-teradata-table-with-1-mil/m-p/308868#M66349</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-11-02T19:58:12Z</dc:date>
    </item>
  </channel>
</rss>

