SQL: optimized index segment resolution. This closes
@@ -804,9 +804,11 @@ public abstract class GridH2IndexBase extends BaseIndex {
protected int segmentForRow(SearchRow row) {
assert row != null;
+ if (segmentsCount() == 1 || ctx == null)
+ return 0;
+
CacheObject key;
- if (ctx != null) {
final Value keyColValue = row.getValue(KEY_COL);
assert keyColValue != null;
@@ -821,11 +823,6 @@ public abstract class GridH2IndexBase extends BaseIndex {
return segmentForPartition(ctx.affinity().partition(key));
}
- assert segmentsCount() == 1;
-
- return 0;
- }
-
/**
* Simple cursor from a single node.
*/
