sanpwc commented on code in PR #1191:
URL: https://github.com/apache/ignite-3/pull/1191#discussion_r1003110434
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -380,6 +403,50 @@ private SortedIndexDescriptor convert(SortedIndexView
indexView) {
);
}
+ private CompletableFuture<BinaryTuple> toIndexKey(TableIndexView
indexView, BinaryRow tableRow) {
+ return tableManager.tableAsyncInternal(indexView.tableId(),
false).thenApply(table -> {
+ SchemaDescriptor descriptor =
table.schemaView().schema(tableRow.schemaVersion());
+
+ int[] indexedColumns = resolveIndexColumns(descriptor, indexView);
+
+ if (indexedColumns == null) {
+ return null;
+ }
+
+ BinaryTupleSchema tupleSchema =
BinaryTupleSchema.createSchema(descriptor, indexedColumns);
Review Comment:
Hmmm, seems that index is actually versioned (within a context of schema
versions) entity. Do we really recalculate tupleSchema on every toIndexKey
call? I mean that there's a map of version -> descriptor and indexView may me
considered as an immutable attribute of an index itself (in-place index update
isn't supported, am I right&?). Thus It seems that index can either be
pre-popularized with tupleSchemas or evaluate and cache them on demand, one
evaluation per each new version in tableRow.
--
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]