github-actions[bot] commented on code in PR #64377:
URL: https://github.com/apache/doris/pull/64377#discussion_r3577461270
##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -3493,6 +3494,15 @@ public void setDetailShapePlanNodes(String
detailShapePlanNodes) {
})
public boolean enableAnnIndexResultCache = true;
+ @VarAttrDef.VarAttr(name = ENABLE_ANN_TOPN_PREDICATE_PREFILTER,
needForward = true, description = {
+ "开启后,带列谓词的 ANN TopN 查询会先把谓词求值成候选位图喂给 ANN 索引(IDSelector),"
Review Comment:
The new `enable_ann_topn_predicate_prefilter` flag needs to be part of the
result-affecting session-variable set, otherwise SQL cache can reuse a cached
ANN TopN result across different values of the flag. `needForward` only sends
the value to BE; it does not make `readAffectQueryResultVariables()` include
it, and the SQL-cache key/validation paths only append that reflected list.
This flag changes predicated ANN TopN from the brute-force fallback (`false`)
to ANN-index search over a prefiltered bitmap (`true`), and approximate ANN
search can return a different top-K than the brute-force path. A session that
caches the query with one setting can therefore hit the same SQL cache entry
after toggling the flag. Please mark this variable
`affectQueryResultInExecution = true` (or otherwise disable SQL cache for this
shape) and add coverage that toggling the flag cannot reuse the cached result.
--
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]