korlov42 commented on code in PR #4151:
URL: https://github.com/apache/ignite-3/pull/4151#discussion_r1698023302


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/Commons.java:
##########
@@ -729,6 +729,17 @@ public static boolean implicitPkEnabled() {
         return IgniteSystemProperties.getBoolean("IMPLICIT_PK_ENABLED", false);
     }
 
+    /**
+     * Control possibility to make simple key value plan optimizations.
+     *
+     * <p>Note: this mode is for test purpose only.
+     *
+     * @return A {@code true} if plan optimization is enabled, {@code false} 
otherwise.
+     */
+    public static boolean simpleKeyValueOptimization() {

Review Comment:
   it's better to merge fresh main to your PR's branch, because there is 
already `fastQueryOptimizationEnabled` with required semantic



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/pruning/PartitionPruningMetadataExtractor.java:
##########
@@ -272,10 +272,21 @@ private void extractFromValues(
         Mappings.TargetMapping mapping = null;
 
         if (projections != null) {
-            projections = replaceInputRefs(projections);
+            List<RexNode> projectionsReplaced = replaceInputRefs(projections);
 
-            mapping = RexUtils.inversePermutation(projections,
-                    table.getRowType(Commons.typeFactory()), true);
+            boolean refFound = !projectionsReplaced.equals(projections);
+
+            if (refFound) {

Review Comment:
   this is not binary choice (all refs vs all expressions). Add the following 
test case t see the problem `TEST("t(C1, C2) SELECT 100, t.x FROM (SELECT 100) 
as T(x)", TABLE_C1_NULLABLE_C2)`
           



-- 
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]

Reply via email to