Performance based on length of "terms"


(pravinhmhatre) #1

I have following criteria in the query. The terms list for seen by can grow significantly large. There are also a couple of similar kind of list in "must_not" clause and those can be grow large too.

              {
                "terms": {
                  "seen_by": [
                    "54",
                    "3",
                    "418",
                    "411",
                    "1",
                    "101"
                  ]
                }
              }

What will be the performance difference if the list of terms in conditions grows or shrinks?

Thanks,
Pravin


(Shay Banon) #2

Hard to answer with exact numbers, the performance will be slower,
obviously, as the list grows. Though, what I suggest is to use terms filter
in this case with execution mode set to bool (new in 0.19:
http://www.elasticsearch.org/guide/reference/query-dsl/terms-filter.html).
This means that the cached filter will be per term, and you will get a
considerably better filter cache hit ration in this case, meaning that for
common terms, it will be a complete in memory bitwise operations.

On Wed, Mar 21, 2012 at 11:46 AM, pravinhmhatre pravinhmhatre@gmail.comwrote:

I have following criteria in the query. The terms list for seen by can
grow significantly large. There are also a couple of similar kind of list
in "must_not" clause and those can be grow large too.

          {
            "terms": {
              "seen_by": [
                "54",
                "3",
                "418",
                "411",
                "1",
                "101"
              ]
            }
          }

What will be the performance difference if the list of terms in conditions
grows or shrinks? Thanks, Pravin

View this message in context: Performance based on length of "terms"http://elasticsearch-users.115913.n3.nabble.com/Performance-based-on-length-of-terms-tp3845134p3845134.html
Sent from the ElasticSearch Users mailing list archivehttp://elasticsearch-users.115913.n3.nabble.com/at Nabble.com.


(system) #3