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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]