<?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 Is join order important ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149350#M30418</link>
    <description>&lt;P&gt;Could someone explain why I have this kind of difference? &lt;BR /&gt;
index=data sourcetype=st1 num=10  --&amp;gt; gives 2 results &lt;BR /&gt;
index=data sourcetype=st2 num=10  --&amp;gt; gives 10 results&lt;/P&gt;

&lt;P&gt;When I tried a join between st1 (first) and st2, I've got 2 results : &lt;BR /&gt;
index=data sourcetype=st1 num=10 | join type=inner num [ search index=data sourcetype=st2 ]  --&amp;gt; gives 2 results&lt;/P&gt;

&lt;P&gt;When I tried a join between st2 (first) and st1, I've got 10 results : &lt;BR /&gt;
index=data sourcetype=st2 num=10 | join type=inner num [ search index=data sourcetype=st1 ]  --&amp;gt; gives 10 results&lt;/P&gt;

&lt;P&gt;I heard that join is similar to SQL join but doesn't look that it works the same way. Any ideas?&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2015 15:04:18 GMT</pubDate>
    <dc:creator>avdbsql</dc:creator>
    <dc:date>2015-04-16T15:04:18Z</dc:date>
    <item>
      <title>Is join order important ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149350#M30418</link>
      <description>&lt;P&gt;Could someone explain why I have this kind of difference? &lt;BR /&gt;
index=data sourcetype=st1 num=10  --&amp;gt; gives 2 results &lt;BR /&gt;
index=data sourcetype=st2 num=10  --&amp;gt; gives 10 results&lt;/P&gt;

&lt;P&gt;When I tried a join between st1 (first) and st2, I've got 2 results : &lt;BR /&gt;
index=data sourcetype=st1 num=10 | join type=inner num [ search index=data sourcetype=st2 ]  --&amp;gt; gives 2 results&lt;/P&gt;

&lt;P&gt;When I tried a join between st2 (first) and st1, I've got 10 results : &lt;BR /&gt;
index=data sourcetype=st2 num=10 | join type=inner num [ search index=data sourcetype=st1 ]  --&amp;gt; gives 10 results&lt;/P&gt;

&lt;P&gt;I heard that join is similar to SQL join but doesn't look that it works the same way. Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 15:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149350#M30418</guid>
      <dc:creator>avdbsql</dc:creator>
      <dc:date>2015-04-16T15:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is join order important ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149351#M30419</link>
      <description>&lt;P&gt;Yes, join order is important.  Join type is also important.  In an inner join, events from the main search are included only if they match an event from the subsearch.  That is why you see the results you do.  An outer join returns all events from both searches.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 15:24:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149351#M30419</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-04-16T15:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is join order important ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149352#M30420</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
&lt;STRONG&gt;Join&lt;/STRONG&gt; order have effect,&lt;/P&gt;

&lt;P&gt;when you write &lt;CODE&gt;index=data sourcetype=st1 num=10 | join type=inner num [ search index=data sourcetype=st2 ]&lt;/CODE&gt; and obtain &lt;STRONG&gt;2&lt;/STRONG&gt; results ,is because the results of  &lt;CODE&gt;index=data sourcetype=st1 num=10&lt;/CODE&gt; who is &lt;STRONG&gt;10&lt;/STRONG&gt; is join with results from search &lt;CODE&gt;search index=data sourcetype=st2&lt;/CODE&gt;  on value field &lt;STRONG&gt;type=inner and field num&lt;/STRONG&gt;.  This returns &lt;STRONG&gt;2&lt;/STRONG&gt; results because there is &lt;STRONG&gt;2&lt;/STRONG&gt; correspondence between the two search on &lt;CODE&gt;type=inner num&lt;/CODE&gt; fields. This is normal that you obtained  &lt;STRONG&gt;2&lt;/STRONG&gt; results.&lt;/P&gt;

&lt;P&gt;Thus, in the second case, is the same thing, because the first search is return &lt;STRONG&gt;10 results&lt;/STRONG&gt; who will join with results of second search .  This returns &lt;STRONG&gt;10&lt;/STRONG&gt; results because there is &lt;STRONG&gt;10&lt;/STRONG&gt; correspondence between the two search on &lt;CODE&gt;type=inner num&lt;/CODE&gt; fields.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;This means that Join do correspondence between results of two  search in both case.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 15:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-join-order-important/m-p/149352#M30420</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-04-16T15:26:55Z</dc:date>
    </item>
  </channel>
</rss>

