gortiz commented on code in PR #8766:
URL: https://github.com/apache/pinot/pull/8766#discussion_r880699775
##########
pinot-core/src/main/java/org/apache/pinot/core/query/pruner/ColumnValueSegmentPruner.java:
##########
@@ -99,6 +102,11 @@ public List<IndexSegment> prune(List<IndexSegment>
segments, QueryContext query)
int numSegments = segments.size();
List<IndexSegment> selectedSegments = new ArrayList<>(numSegments);
+
+ // By using an IdentityHashMap, we may be creating more entries, but each
lookup will be faster
+ // which should compensate in cases where there are hundreds of segments
+ Map<Object, Hash128> hashCache = new IdentityHashMap<>();
Review Comment:
IdentityMap removes the call to equals, which can be relatively expensive
when the keys (specially strings) are not the same reference but has the same
hash code. This is can happen when an expression contains the same literal
several times. For example, in the following query, the literal "someString"
may be the same instance or a different one:
```sql
select * from Table where col1 = "someString" and col2 = "someString"
```
--
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]