>From Janhavi Tripurwar <[email protected]>: Janhavi Tripurwar has uploaded a new patch set (#2). ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21368?usp=email )
Change subject: [ASTERIXDB-XXXX][COMP]: speed up access-method analysis dedup from O(n^2) to O(n) ...................................................................... [ASTERIXDB-XXXX][COMP]: speed up access-method analysis dedup from O(n^2) to O(n) Details: - AccessMethodUtils.addNewOptFuncExprToAnalysisCtx deduplicated each new candidate by scanning all already-matched func-exprs and calling a deep AbstractFunctionCallExpression.equals() on each. Per insertion this is O(n x expr-size), i.e. O(n^2) overall for conditions with many conjuncts/disjuncts (e.g. a large IN list expanded to a 430-way OR). - Add a side HashSet<AbstractFunctionCallExpression> (matchedFuncExprSet) in AccessMethodAnalysisContext, maintained in lockstep with matchedFuncExprs via addMatchedFuncExpr, and replace the linear scan with an O(1) containsMatchedFuncExpr() lookup. - Compile-time only; no runtime/plan change. Change-Id: Ie9cbb77084510244bd119cbd2f1023c816ae351e --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodAnalysisContext.java M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java 2 files changed, 15 insertions(+), 5 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/68/21368/2 -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21368?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: Ie9cbb77084510244bd119cbd2f1023c816ae351e Gerrit-Change-Number: 21368 Gerrit-PatchSet: 2 Gerrit-Owner: Janhavi Tripurwar <[email protected]> Gerrit-CC: Anon. E. Moose #1000171 Gerrit-CC: Jenkins <[email protected]>
