itschrispeck commented on code in PR #13533:
URL: https://github.com/apache/pinot/pull/13533#discussion_r1747820425


##########
pinot-core/src/test/java/org/apache/pinot/core/query/optimizer/QueryOptimizerTest.java:
##########
@@ -293,6 +293,11 @@ public void testQueries() {
             + "AND TEXT_MATCH(string2, 'foo2') AND TEXT_MATCH(string2, 
'bar2')",
         "SELECT * FROM testTable WHERE TEXT_MATCH(string1, '(foo1 AND bar1)') 
AND TEXT_MATCH(string2, '(foo2 AND "
             + "bar2)')");
+    testQuery("SELECT * FROM testTable WHERE TEXT_MATCH(string, 'foo') OR NOT 
TEXT_MATCH(string, 'bar')",

Review Comment:
   I did consider this, but I think it often results in poorer performance. 
   
   The generic `NOT text_match(col, 'str')` rewrite to `text_match(col, '*:* 
NOT str')` does solve the accuracy issues of NRT search, but in our testing 
significantly slowed down a large % of queries. I wasn't comfortable making the 
change since the optimizer is used by default. 
   
   In general the approach of `TextMatchFilterOptimizer` only rewrites 
expressions that are almost always improved (the one edge case is called out in 
the original PR)



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to