<?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: Speeding Up a Search Query Matching Subquery Results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Speeding-Up-a-Search-Query-Matching-Subquery-Results/m-p/423005#M121440</link>
    <description>&lt;P&gt;Since in my case my KV store is attempting to reference specific events for lookup later, I wanted to see if searching for events using only a fairly unique, non-string field like _time would improve performance. I tried both using Where In Syntax (with a list of times to match) and an OR list (i.e. _time=1 OR _time=2 ...). Both perform markedly worse (two orders of magnitude) than the subsearch returning the field values to match. I wanted to also attempt to return _time back from a subsearch to see if that made a difference, but returning the internal _time field from the subsearch resulted in no results being found (presumably because it isn't actually returned as an internal field).&lt;/P&gt;

&lt;P&gt;I actually found this behavior rather unintuitive. I assumed that since integer comparisons can be performed faster than string comparisons and because Splunk seems to be optimized already for time based comparisons (with its time window searches), I would see better results. But it seems like that is a dead-end unless there is some more performant way to structure my search query based on a list of times.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jan 2019 13:07:58 GMT</pubDate>
    <dc:creator>SplunkPersonal</dc:creator>
    <dc:date>2019-01-24T13:07:58Z</dc:date>
    <item>
      <title>Speeding Up a Search Query Matching Subquery Results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Speeding-Up-a-Search-Query-Matching-Subquery-Results/m-p/423004#M121439</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a search I'm trying to speed up. I have a list of field values stored in a KV store. I use an inputlookup subsearch to feed those field values into a main search for all events that match any of those fields. Like this:&lt;/P&gt;

&lt;P&gt;index=myevents  [ | inputlookup MyKV | table MyFieldValues | fields MyFieldValues]&lt;/P&gt;

&lt;P&gt;This search returns the events I want, but I'm looking for this search to complete more quickly. Time-based filtering won't work (the events span all-time). Other ways of trying to pare down the results before running the subsearch also provided no significant speed increases.&lt;/P&gt;

&lt;P&gt;I started looking into data models with accelerations to see if I could get better performance. But I'm seeing markedly &lt;EM&gt;worse&lt;/EM&gt; performance when I create an accelerated data model and search it using "| datamodel mymodel search | search [ | inputlookup MyKV | table MyFieldValues | fields MyFieldValues]. Maybe I'm doing something wrong with how I search, but I couldn't find documentation to suggest that's the case.&lt;/P&gt;

&lt;P&gt;Is there any way to speed up performance of my search. Or is Splunk already by default optimized in a way I can't really improve upon here? &lt;/P&gt;

&lt;P&gt;Thanks for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 04:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Speeding-Up-a-Search-Query-Matching-Subquery-Results/m-p/423004#M121439</guid>
      <dc:creator>SplunkPersonal</dc:creator>
      <dc:date>2019-01-24T04:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Speeding Up a Search Query Matching Subquery Results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Speeding-Up-a-Search-Query-Matching-Subquery-Results/m-p/423005#M121440</link>
      <description>&lt;P&gt;Since in my case my KV store is attempting to reference specific events for lookup later, I wanted to see if searching for events using only a fairly unique, non-string field like _time would improve performance. I tried both using Where In Syntax (with a list of times to match) and an OR list (i.e. _time=1 OR _time=2 ...). Both perform markedly worse (two orders of magnitude) than the subsearch returning the field values to match. I wanted to also attempt to return _time back from a subsearch to see if that made a difference, but returning the internal _time field from the subsearch resulted in no results being found (presumably because it isn't actually returned as an internal field).&lt;/P&gt;

&lt;P&gt;I actually found this behavior rather unintuitive. I assumed that since integer comparisons can be performed faster than string comparisons and because Splunk seems to be optimized already for time based comparisons (with its time window searches), I would see better results. But it seems like that is a dead-end unless there is some more performant way to structure my search query based on a list of times.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 13:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Speeding-Up-a-Search-Query-Matching-Subquery-Results/m-p/423005#M121440</guid>
      <dc:creator>SplunkPersonal</dc:creator>
      <dc:date>2019-01-24T13:07:58Z</dc:date>
    </item>
  </channel>
</rss>

