You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/12/01 14:20:22 UTC

[GitHub] [ignite] zstan commented on a diff in pull request #10397: IGNITE-13030 SQL Calcite: Inline index scans

zstan commented on code in PR #10397:
URL: https://github.com/apache/ignite/pull/10397#discussion_r1032359089


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheIndexImpl.java:
##########
@@ -190,4 +197,30 @@ public Index queryIndex() {
         // Empty index find predicate.
         return null;
     }
+
+    /** {@inheritDoc} */
+    @Override public boolean isInlineScanPossible(@Nullable ImmutableBitSet requiredColumns) {
+        if (idx == null)
+            return false;
+
+        if (requiredColumns == null)
+            requiredColumns = ImmutableBitSet.range(tbl.descriptor().columnDescriptors().size());
+
+        ImmutableIntList idxKeys = collation.getKeys();
+
+        // All indexed keys should be inlined, all required colummns should be inlined.
+        if (idxKeys.size() < requiredColumns.cardinality() || !ImmutableBitSet.of(idxKeys).contains(requiredColumns))
+            return false;
+
+        List<IndexKeyDefinition> keyDefs = new ArrayList<>(idx.unwrap(InlineIndex.class).indexDefinition()
+            .indexKeyDefinitions().values());
+
+        for (InlineIndexKeyType keyType : InlineIndexKeyTypeRegistry.types(keyDefs, new IndexKeyTypeSettings())) {
+            // Skip variable length keys and java objects (see comments about these limitations in IndexScan class).

Review Comment:
   more accurate is to use @see notation here, it would be invalidated in case of class name change.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org