Skip to content

[Feature Request] Improve the performance of numeric range queries #18334

@kkewwei

Description

@kkewwei

Is your feature request related to a problem? Please describe

In #13788, we introduce ApproximatePointRangeQuery for long and date type. However, several potential optimizations remain to be explored:

  1. ApproximatePointRangeQuery is only used in long type, but doesn't used in integer, double, float type, we can extend the ApproximatePointRangeQuery to those numeric types.
  2. ApproximatePointRangeQuery can't used in the follow dsl, which just add a bool on the outer compared with the standard dsl.
GET logs1/_search
{
    "query": {
        "bool": {
            "must": [
               {
                   "range": {
                      "size": {
                         "from": 1
                      }
                   }
               }
            ]
        }
    }
}
  1. Consider extending ApproximatePointRangeQuery to term queries. For low-cardinality field, this could yield better optimization results.
  2. For the ApproximatePointRangeQuery, we will visit at least trackTotalHitsUpTo(defalut 10k) docs in BKD tree, it may be more efficient to limit the visit to the size (default: 10) to reduce unnecessary overhead for the non-scoring case.

Describe the solution you'd like

no

Related component

Search:Performance

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions