You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2022/11/12 05:57:00 UTC
[GitHub] [phoenix] stoty commented on a diff in pull request #1529: PHOENIX-6752 Duplicate expression nodes in extract nodes during WHERE compilation phase leads to poor performance
stoty commented on code in PR #1529:
URL: https://github.com/apache/phoenix/pull/1529#discussion_r1020680442
##########
phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java:
##########
@@ -926,7 +932,11 @@ private KeySlots andKeySlots(AndExpression andExpression, List<KeySlots> childSl
if (slot.getOrderPreserving() != null) {
orderPreserving = slot.getOrderPreserving().combine(orderPreserving);
}
- if (slot.getKeyPart().getExtractNodes() != null) {
+ // Extract once per iteration, when there are large number
+ // of OR clauses (for e.g N > 100k).
+ // The extractNodes.addAll method can get called N times.
+ if (!visitedKeyParts.contains(slot.getKeyPart()) && slot.getKeyPart().getExtractNodes() != null) {
Review Comment:
Does this contains() check improve perf ?
I'd expect checking then adding an existing element to a hash to take similar (or more) time to simply adding it, and letting the hash take care of duplicates.
--
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: issues-unsubscribe@phoenix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org