Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7677

Cache compound filters earlier than regular queries

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0, 6.5
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Say you keep reusing a boolean filter that looks like "A OR B" and never use the A and B queries out of that boolean query. Currently, after this filter has been used 5 times, we would cache both A, B and "A OR B", which means that cache entries for A and B would only be built for the purpose of building a cache entry for "A OR B", which is wasteful.

      By caching compound queries a bit earlier, we could make it less likely to happen since:

      • we only consider queries as consumed if a scorer is pulled
      • once the boolean query is cached, we stop pulling scorers on the A and B queries

        Activity

        Hide
        jpountz Adrien Grand added a comment -

        Here is a patch that implements this idea.

        Show
        jpountz Adrien Grand added a comment - Here is a patch that implements this idea.
        Hide
        dsmiley David Smiley added a comment -

        +1 nice, especially the embedded comments

        Show
        dsmiley David Smiley added a comment - +1 nice, especially the embedded comments
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2d3487dba2de46a68df977b5abf2c3f242b90158 in lucene-solr's branch refs/heads/master from Adrien Grand
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2d3487d ]

        LUCENE-7677: Cache compound filters earlier than regular filters.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2d3487dba2de46a68df977b5abf2c3f242b90158 in lucene-solr's branch refs/heads/master from Adrien Grand [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2d3487d ] LUCENE-7677 : Cache compound filters earlier than regular filters.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1bfa057d5c9d89b116031baa7493ee422b4cbabb in lucene-solr's branch refs/heads/branch_6x from Adrien Grand
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=1bfa057 ]

        LUCENE-7677: Cache compound filters earlier than regular filters.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1bfa057d5c9d89b116031baa7493ee422b4cbabb in lucene-solr's branch refs/heads/branch_6x from Adrien Grand [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=1bfa057 ] LUCENE-7677 : Cache compound filters earlier than regular filters.

          People

          • Assignee:
            Unassigned
            Reporter:
            jpountz Adrien Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development