iverase commented on a change in pull request #730: LUCENE-8868: New storing
strategy for BKD tree leaves with low cardinality
URL: https://github.com/apache/lucene-solr/pull/730#discussion_r295697334
##########
File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
##########
@@ -1028,17 +1035,43 @@ private void writeLeafBlockDocs(DataOutput out, int[]
docIDs, int start, int cou
DocIdsWriter.writeDocIds(docIDs, start, count, out);
}
- private void writeLeafBlockPackedValues(DataOutput out, int[]
commonPrefixLengths, int count, int sortedDim, IntFunction<BytesRef>
packedValues) throws IOException {
+ private void writeLeafBlockPackedValues(DataOutput out, int[]
commonPrefixLengths, int count, int sortedDim, IntFunction<BytesRef>
packedValues, int leafCardinality) throws IOException {
int prefixLenSum = Arrays.stream(commonPrefixLengths).sum();
if (prefixLenSum == packedBytesLength) {
// all values in this block are equal
out.writeByte((byte) -1);
- } else {
+ } else if (leafCardinality * (packedBytesLength - prefixLenSum + 2) <=
count * (packedBytesLength - prefixLenSum)) {
Review comment:
Yes, I was too conservative .
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]