<?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: Is there any performance impact when you use &amp;quot;search&amp;quot; vs using &amp;quot;where&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211562#M61908</link>
    <description>&lt;P&gt;search is going to be slightly more efficient than where, but not enough that you would notice for any realistic search scenario.  Both commands can comparing the value of a field to some static value, but that is where the commonality ends.  'where' can be used to compare 2 fields against each other, to compared complex functions of a field to other fields or static values.  E.g. you can't do something like to compare fields x and y.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search x&amp;gt;y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That search would actually search for cases where field x is greater (lexicographically) than the literal value "y"&lt;/P&gt;

&lt;P&gt;Note that this is also why the syntax for search and where are slightly different.  Because search is designed to compare a field against a static value, it assumes the right hand side of any expression is a literal value.  For where, the RHS can be a literal or a field, so literals need to be disambiguated by using double quotes. &lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2015 00:21:13 GMT</pubDate>
    <dc:creator>steveyz</dc:creator>
    <dc:date>2015-09-02T00:21:13Z</dc:date>
    <item>
      <title>Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211556#M61902</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am wondering if there is any guidelines as to using the "search" or "where" commands within a search query when trying to filter data. It seems that both can be used sort of interchangeably. I am curious if there is any performance impact of using one over the other.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211556#M61902</guid>
      <dc:creator>ShawnClark</dc:creator>
      <dc:date>2015-09-01T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211557#M61903</link>
      <description>&lt;P&gt;Hi ShawnClark,&lt;/P&gt;

&lt;P&gt;there are tons of answers to this question, but here is the best one:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/128739/difference-between-where-and-search-commands.html"&gt;https://answers.splunk.com/answers/128739/difference-between-where-and-search-commands.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Kudos go to @martin_mueller &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 21:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211557#M61903</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-09-01T21:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211558#M61904</link>
      <description>&lt;P&gt;Reading that thread doesn't instill much confidence in the performance difference between using one over the other. The last comment "I doubt there's a significant difference in performance..." is more a gut feeling instead of actually numbers around it. I was hoping to find someone that has done some evaluations of both or a Splunk engineer giving insight on why there is both ways of doing the same thing. If there isn't anything out there then I will have to try some evaluations myself. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 21:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211558#M61904</guid>
      <dc:creator>ShawnClark</dc:creator>
      <dc:date>2015-09-01T21:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211559#M61905</link>
      <description>&lt;P&gt;In my experience the where clause is good for well defined fields/extractions.  While the search command allows you to find text which my be in multiple fields or in the _raw data.  Depending on the use case one will perform better than the other. &lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 22:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211559#M61905</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2015-09-01T22:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211560#M61906</link>
      <description>&lt;P&gt;Okay, I changed the question since you are interested in the performance impact and not the basic difference between when to use &lt;CODE&gt;search&lt;/CODE&gt; or &lt;CODE&gt;where&lt;/CODE&gt;. &lt;BR /&gt;
Nevertheless I did some basic searches on my VM and here are the results;&lt;/P&gt;

&lt;P&gt;Each search was run three times and results are in seconds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=0 | where sourcetype="splunkd" | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;38.717&lt;/LI&gt;
&lt;LI&gt;34.757&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;33.494&lt;/P&gt;

&lt;P&gt;index=_internal earliest=0 | search sourcetype="splunkd" | stats count by sourcetype&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;34.569&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;36.454&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;33.638&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 22:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211560#M61906</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-09-01T22:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211561#M61907</link>
      <description>&lt;P&gt;For more speed you'll want this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal earliest=0 sourcetype="splunkd" | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Sep 2015 23:59:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211561#M61907</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-09-01T23:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any performance impact when you use "search" vs using "where"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211562#M61908</link>
      <description>&lt;P&gt;search is going to be slightly more efficient than where, but not enough that you would notice for any realistic search scenario.  Both commands can comparing the value of a field to some static value, but that is where the commonality ends.  'where' can be used to compare 2 fields against each other, to compared complex functions of a field to other fields or static values.  E.g. you can't do something like to compare fields x and y.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search x&amp;gt;y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That search would actually search for cases where field x is greater (lexicographically) than the literal value "y"&lt;/P&gt;

&lt;P&gt;Note that this is also why the syntax for search and where are slightly different.  Because search is designed to compare a field against a static value, it assumes the right hand side of any expression is a literal value.  For where, the RHS can be a literal or a field, so literals need to be disambiguated by using double quotes. &lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2015 00:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-performance-impact-when-you-use-quot-search-quot-vs/m-p/211562#M61908</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2015-09-02T00:21:13Z</dc:date>
    </item>
  </channel>
</rss>

