<?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: Does order of the variables in a composite index matter? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476610#M71233</link>
    <description>If your key is unique within a year, you could even be fine with a single index. &lt;BR /&gt;What is your application? End users asking for a one key value at the time? And sub second response times?&lt;BR /&gt;If you are in a Base SAS libref now, consider SPDE instead - parallel IO and better index management and query plans.&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Jul 2018 20:59:51 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2018-07-09T20:59:51Z</dc:date>
    <item>
      <title>Does order of the variables in a composite index matter?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/475279#M71141</link>
      <description>&lt;P&gt;Does the order of the data in a composite index matter? I have a composite index of an 8 character key + 4 character year. The year can only be one of 20 past years, the key can be any combination of letters and numbers. If my data has 100 million rows, approximately 5 million for each year, does it matter if I create a composite index as key+year or year+key?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if the subsetting of the data by year would make the index (year+key) a bit faster than the other way around.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 17:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/475279#M71141</guid>
      <dc:creator>set_all__</dc:creator>
      <dc:date>2018-07-03T17:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Does order of the variables in a composite index matter?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/475289#M71146</link>
      <description>&lt;P&gt;Is your data sorted?&amp;nbsp; Usually you would try to mimic the sorted order of the data as the primary key.&amp;nbsp; (It also depends on the patterns of records that you want to retrieve.)&amp;nbsp; Here's why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When retrieving a record using an index, SAS doesn't retrieve data directly from the source data set.&amp;nbsp; Rather, it moves a block of records (that includes the next one you want) into memory.&amp;nbsp; From that block, it retrieves the next record that you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The major cost is moving the block of data that contains the next desired record.&amp;nbsp; Retrieving an individual record is a minimal cost.&amp;nbsp; So minimize the movement of blocks of records.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 18:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/475289#M71146</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-03T18:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Does order of the variables in a composite index matter?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476568#M71228</link>
      <description>&lt;P&gt;The data is not sorted. It&amp;nbsp;could possibly&amp;nbsp;take too much time to sort the 100 million records before I need to kick off the next process in a short monthly production window. However, I am testing this out. I am also going to check if separating this dataset into multiple datasets (by year/multiple years) would make it any faster. Thanks for the suggestion!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 19:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476568#M71228</guid>
      <dc:creator>set_all__</dc:creator>
      <dc:date>2018-07-09T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Does order of the variables in a composite index matter?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476594#M71232</link>
      <description>&lt;P&gt;Why not make 2 composite indices, and run some tests?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect, as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;suggested, that you should order the components of a composite index that most closely approximate&amp;nbsp;the physical record order of the indexed data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 20:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476594#M71232</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-07-09T20:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Does order of the variables in a composite index matter?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476610#M71233</link>
      <description>If your key is unique within a year, you could even be fine with a single index. &lt;BR /&gt;What is your application? End users asking for a one key value at the time? And sub second response times?&lt;BR /&gt;If you are in a Base SAS libref now, consider SPDE instead - parallel IO and better index management and query plans.&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jul 2018 20:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Does-order-of-the-variables-in-a-composite-index-matter/m-p/476610#M71233</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-07-09T20:59:51Z</dc:date>
    </item>
  </channel>
</rss>

