jpountz commented on a change in pull request #607:
URL: https://github.com/apache/lucene/pull/607#discussion_r786988227
##########
File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
##########
@@ -105,6 +107,51 @@ public BKDReader(IndexInput metaIn, IndexInput indexIn,
IndexInput dataIn) throw
}
this.packedIndex = indexIn.slice("packedIndex", indexStartPointer,
numIndexBytes);
this.in = dataIn;
+ this.isTreeBalanced = isTreeBalanced();
+ }
+
+ private boolean isTreeBalanced() throws IOException {
+ if (version >= BKDWriter.VERSION_META_FILE || numLeaves == 1) {
+ // since lucene 8.6 all trees are unbalanced.
+ // for only one leaf we can assume unbalanced.
+ return false;
+ }
Review comment:
I don't think this is correct. Merging has these lines of code:
```
for (PointsReader reader : mergeState.pointsReaders) {
if (reader instanceof Lucene60PointsReader == false) {
// We can only bulk merge when all to-be-merged segments use our
format:
super.merge(mergeState);
return;
}
}
```
and the default merge implementation (`super.merge`) would create a balanced
tree with pre-8.6, even in the 1D case.
--
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]