Solr
  1. Solr
  2. SOLR-5002

optimize numDocs(Query,DocSet) when filterCache is null

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      getDocSet(Query, DocSet) has this opto, but numDocs does not.

      Especially in this case, where we just want the intersection count, its faster to do a filtered query with TotalHitCountCollector and not create bitsets at all...

        Activity

        Hide
        Robert Muir added a comment -

        patch: one trick is we cant actually use FilteredQuery because of some sneaky stuff in UninvertedField (which also uses this method). See the comment. So to be safe, it just uses a conjunction.

        This is ~ 50% faster for my facet-by-query benchmark, when there is no filter cache.

        Show
        Robert Muir added a comment - patch: one trick is we cant actually use FilteredQuery because of some sneaky stuff in UninvertedField (which also uses this method). See the comment. So to be safe, it just uses a conjunction. This is ~ 50% faster for my facet-by-query benchmark, when there is no filter cache.
        Hide
        Uwe Schindler added a comment -

        one trick is we cant actually use FilteredQuery because of some sneaky stuff in UninvertedField (which also uses this method). See the comment.

        I am nervous if this is a hidden bug in solr that could be affect other stuff. If a UninvertedField.doNegative() handles deleted documents in a wrong way and you are able to create a filter out of it, it could lead to wrong results, if the filter is applied down-low (random access).

        Show
        Uwe Schindler added a comment - one trick is we cant actually use FilteredQuery because of some sneaky stuff in UninvertedField (which also uses this method). See the comment. I am nervous if this is a hidden bug in solr that could be affect other stuff. If a UninvertedField.doNegative() handles deleted documents in a wrong way and you are able to create a filter out of it, it could lead to wrong results, if the filter is applied down-low (random access).
        Hide
        Robert Muir added a comment -

        I dont think so, but thats why I used a conjunction so I dont have to deal with it on this issue and can look at it separately.

        Show
        Robert Muir added a comment - I dont think so, but thats why I used a conjunction so I dont have to deal with it on this issue and can look at it separately.
        Hide
        ASF subversion and git services added a comment -

        Commit 1500102 from Robert Muir
        [ https://svn.apache.org/r1500102 ]

        SOLR-5002: optimize numDocs(Query,DocSet) when filterCache is null

        Show
        ASF subversion and git services added a comment - Commit 1500102 from Robert Muir [ https://svn.apache.org/r1500102 ] SOLR-5002 : optimize numDocs(Query,DocSet) when filterCache is null
        Hide
        ASF subversion and git services added a comment -

        Commit 1500110 from Robert Muir
        [ https://svn.apache.org/r1500110 ]

        SOLR-5002: optimize numDocs(Query,DocSet) when filterCache is null

        Show
        ASF subversion and git services added a comment - Commit 1500110 from Robert Muir [ https://svn.apache.org/r1500110 ] SOLR-5002 : optimize numDocs(Query,DocSet) when filterCache is null
        Hide
        Robert Muir added a comment -

        No more unrelated discussion here.

        Show
        Robert Muir added a comment - No more unrelated discussion here.

          People

          • Assignee:
            Robert Muir
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development