You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Guoqiang Jiang (Jira)" <ji...@apache.org> on 2019/10/09 04:50:00 UTC

[jira] [Comment Edited] (LUCENE-9002) query caching leads to absurdly slow queries

    [ https://issues.apache.org/jira/browse/LUCENE-9002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16947359#comment-16947359 ] 

Guoqiang Jiang edited comment on LUCENE-9002 at 10/9/19 4:49 AM:
-----------------------------------------------------------------

For easy understanding, I am attaching an ES query example:
{code:java}
GET host_monitor/_search
{
  "size": 10000, 
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "host_ip": "10.60.48.10"
          }
        },
        {
          "range": {
            "timestamp": {
              "gte": "now-5d/d",
              "lt": "now/d"
            }
          }
        }
      ]
    }
  },
  "docvalue_fields": ["cpu_usage"]
}
{code}




was (Author: jgq2008303393):
For easy understanding, I am attaching a real ES query:
{code:java}
GET host_monitor/_search
{
  "size": 10000, 
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "host_ip": "xxx"
          }
        },
        {
          "range": {
            "timestamp": {
              "gte": "now-5d/d",
              "lt": "now/d"
            }
          }
        }
      ]
    }
  },
  "docvalue_fields": ["cpu_usage"]
}
{code}



> query caching leads to absurdly slow queries
> --------------------------------------------
>
>                 Key: LUCENE-9002
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9002
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 7.7.2, 8.2
>            Reporter: Guoqiang Jiang
>            Priority: Major
>              Labels: cache, performance
>
> *Description*
> We have dozens of ES clusters(based on Lucene) for metric scenarios. Most of the queries are like this: _host_ip:10.10.10.10 AND timestamp:[2019-10-01 00:00:00 TO 2019-10-05 23:59:59]_. And we frequently encounter some absurdly slow queries.
> *Solution*
> For a long time range query(e.g. 5 days), each range query will consume tens of megabytes of memory and spend hundreds of milliseconds to cache, but the benefits are not obvious. And those large cache entries will cause frequent cache eviction. So it's better to  skip the caching action directly when large range query appears with a selective lead iterator.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org