<?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: Exploit Index with Large List in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249316#M46887</link>
    <description>&lt;P&gt;I guess another way to state "Is there a way to exploit an index outside of a&amp;nbsp;WHERE"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not finding anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background is that we need 6 tables (and counting...) attached to a table with 1.9 billion rows on a persistent basis. A full table scan is not an option, and SQL gets messy really quickly. There is an indexed field&amp;nbsp;in common with one of the attached tables that needs to be filtered on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The best I can think of is what you said, to populate a macro variable and load that into the WHERE.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2016 21:28:38 GMT</pubDate>
    <dc:creator>DanZ</dc:creator>
    <dc:date>2016-02-10T21:28:38Z</dc:date>
    <item>
      <title>Exploit Index with Large List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249299#M46881</link>
      <description>&lt;P&gt;Is there an efficient way to exploit an index (45k unique) using a list of ~1k values without entering them into the WHERE? Is there some method of loading the list into a hash and pulling it into the where instead of into a subsetting if?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 20:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249299#M46881</guid>
      <dc:creator>DanZ</dc:creator>
      <dc:date>2016-02-10T20:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Exploit Index with Large List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249305#M46884</link>
      <description>Not sure what you are asking. What is your "problem"?&lt;BR /&gt; How do you select your 1k values?&lt;BR /&gt;If you have your 1k values in a lookup table you could either fill them into a macro variable to be used in a WHERE statement. &lt;BR /&gt;Or a simple inner join, if you are lucky SQL will use hash join as it's internal plan.&lt;BR /&gt;&lt;BR /&gt;Using a data step hash makes no sense (if I ubders5your inquiry correctly ), it will require a table scan, and will be able to use the index.</description>
      <pubDate>Wed, 10 Feb 2016 20:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249305#M46884</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-10T20:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Exploit Index with Large List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249316#M46887</link>
      <description>&lt;P&gt;I guess another way to state "Is there a way to exploit an index outside of a&amp;nbsp;WHERE"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not finding anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background is that we need 6 tables (and counting...) attached to a table with 1.9 billion rows on a persistent basis. A full table scan is not an option, and SQL gets messy really quickly. There is an indexed field&amp;nbsp;in common with one of the attached tables that needs to be filtered on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The best I can think of is what you said, to populate a macro variable and load that into the WHERE.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 21:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249316#M46887</guid>
      <dc:creator>DanZ</dc:creator>
      <dc:date>2016-02-10T21:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exploit Index with Large List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249324#M46890</link>
      <description>&lt;P&gt;It would help if you could post your SQL so what you are trying to achieve is clearer to everyone.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 21:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249324#M46890</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-02-10T21:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Exploit Index with Large List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249332#M46895</link>
      <description>Still understand the "outside where" part.&lt;BR /&gt;Sounds you need to optimize joins between lookup tables and a large master table. So the best you can come with is either a where in () or SQL with indexed or hash join.&lt;BR /&gt;&lt;BR /&gt;1.9 billion rows, in a Base SAS libname?&lt;BR /&gt;You could exploit SPDE, it may not optimize joins, but deals with indexes (update, where evaluation) better than Base.&lt;BR /&gt;&lt;BR /&gt;If this is a really important use case, consider invest in SPD Server which has an index type specific for join optimization, and a star schema planner (which builds this in () clause automatically behind the scenes).</description>
      <pubDate>Wed, 10 Feb 2016 22:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exploit-Index-with-Large-List/m-p/249332#M46895</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-10T22:22:23Z</dc:date>
    </item>
  </channel>
</rss>

