guptashivam04 opened a new pull request, #71377:
URL: https://github.com/apache/doris/pull/71377

   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #70678
   PR Type: Improvement
   
   Problem Summary:
   
   Cherry-pick of #70678 to branch-4.2. It applies without conflicts.
   
   A SEARCH next to a selective filter outside it, such as `account_id = X AND 
search(...)`, evaluated the SEARCH over the whole segment and intersected the 
account's rows only afterwards. With this change a SEARCH that is a whole 
filtering conjunct starts from the rows the scan's other filters kept. Only the 
root reads within them, a result read this way never enters the DSL cache, and 
scored SEARCH is unchanged. See #70678 for details.
   
   ### Numbers on branch-4.2
   
   2M rows, 3 BEs, inverted index on `account_id`, caches off, median of 12 
runs alternating the two builds. Rows are identical on all 19 queries.
   
   | query | before | after |
   |---|---|---|
   | ranking query of 16 SEARCH scans, account with 681 rows | 1664 ms, 10.3 s 
CPU | 1233 ms, 7.3 s CPU |
   | same, account with 50K rows (2.5%) | 2364 ms, 12.8 s CPU | 2057 ms, 13.0 s 
CPU |
   | single SEARCH, `score()` and top-k queries | | unchanged |
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
           - `search/test_search_outer_filter_candidates` passes on branch-4.2 
with this change and without it (the `.out` holds the rows and scores of the 
SEARCH filtered afterwards).
           - All 44 `search/` suites pass on a local branch-4.2 cluster, with 
and without this change.
       - [x] Unit Test: 
`BooleanTruthContractTest.CollectionWithinCandidatesKeepsTheirMatches`, carried 
over from #70678.
   - Behavior changed: No. Rows and scores are the same.
   - Does this need documentation: No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to