<?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 Lookup vs join with inputlookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388769#M113357</link>
    <description>&lt;P&gt;We were testing performance and for some reason a join with an inputlookup is faster than a direct lookup.&lt;BR /&gt;
Sample query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup serviceid
| rename serviceid as service_id 
| join type=outer service_id 
[| inputlookup service_runtime ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;VS&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itsi_summary 
| dedup serviceid
| rename serviceid as service_id 
| lookup service_runtime service_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought the lookup would be faster and basicly execute the join with the inputlookup itself. But after trying a few hundred times 99% of the time the join with inputlookup is faster.&lt;BR /&gt;
In what cases should we use lookup instead of a join with an inputlookup?&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 15:54:00 GMT</pubDate>
    <dc:creator>sboogaar</dc:creator>
    <dc:date>2019-05-28T15:54:00Z</dc:date>
    <item>
      <title>Lookup vs join with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388769#M113357</link>
      <description>&lt;P&gt;We were testing performance and for some reason a join with an inputlookup is faster than a direct lookup.&lt;BR /&gt;
Sample query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup serviceid
| rename serviceid as service_id 
| join type=outer service_id 
[| inputlookup service_runtime ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;VS&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itsi_summary 
| dedup serviceid
| rename serviceid as service_id 
| lookup service_runtime service_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought the lookup would be faster and basicly execute the join with the inputlookup itself. But after trying a few hundred times 99% of the time the join with inputlookup is faster.&lt;BR /&gt;
In what cases should we use lookup instead of a join with an inputlookup?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388769#M113357</guid>
      <dc:creator>sboogaar</dc:creator>
      <dc:date>2019-05-28T15:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup vs join with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388770#M113358</link>
      <description>&lt;P&gt;Here you are doing a very unique operation of comparing two tables and choosing to combine them by a field, and combining ALL fields in the table.  This is only faster because you have one field to compare and have already run a dedup on the tables. If at any point you required multiple matches or have multiple fields to match on or the search retrieves only a small number of events and the lookup table is tens of thousands or more the lookup table method would be the appropriate option. &lt;/P&gt;</description>
      <pubDate>Sun, 02 Jun 2019 16:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388770#M113358</guid>
      <dc:creator>aromanauskas</dc:creator>
      <dc:date>2019-06-02T16:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup vs join with inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388771#M113359</link>
      <description>&lt;P&gt;I got the exact opposite observation, hence the same question.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex
| join field1
    [inputlookup table1]
| more filters
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;vs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex
| lookup table1 field1 as field1 OUTPUTNEW field2 as field2
| where field2 == 'value2'
| more filters
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first search (join) nearly quadruples the time used by the second (lookup).  More interestingly, join itself only consumes a fraction of the extra time. (My lookup table is only a few lines.)&lt;/P&gt;

&lt;P&gt;To make matter even more interesting, this search (without explicit join)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex [ | inputlookup table1 |fields field1 ]
| more filters
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is about as fast or marginally faster than the second (lookup).  All three are functionally identical for my purpose.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 19:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-vs-join-with-inputlookup/m-p/388771#M113359</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2020-02-25T19:48:08Z</dc:date>
    </item>
  </channel>
</rss>

