You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by tl...@apache.org on 2021/02/02 11:12:10 UTC

[ignite] branch sql-calcite updated: IGNITE-13566 Calcite integration. Table size statistics for cost planer (#8678)

This is an automated email from the ASF dual-hosted git repository.

tledkov pushed a commit to branch sql-calcite
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/sql-calcite by this push:
     new 563c832  IGNITE-13566 Calcite integration. Table size statistics for cost planer (#8678)
563c832 is described below

commit 563c832eb2d5d40fcd6aa52c3696c6f854929787
Author: Stanilovsky Evgeny <st...@gmail.com>
AuthorDate: Tue Feb 2 14:10:33 2021 +0300

    IGNITE-13566 Calcite integration. Table size statistics for cost planer (#8678)
---
 .../query/calcite/rel/AbstractIndexScan.java       |   6 +-
 .../query/calcite/schema/IgniteTableImpl.java      |  18 +-
 .../query/calcite/schema/TableDescriptor.java      |   6 +
 .../query/calcite/schema/TableDescriptorImpl.java  |   5 +
 .../CalciteBasicSecondaryIndexIntegrationTest.java | 267 +++++++++++++++++++--
 .../query/calcite/CalciteQueryProcessorTest.java   |  14 --
 .../query/calcite/SqlFieldsQueryUsageTest.java     | 103 ++++++++
 .../calcite/planner/IndexSpoolPlannerTest.java     |   1 -
 .../query/calcite/rules/OrToUnionRuleTest.java     |  21 +-
 .../ignite/testsuites/IgniteCalciteTestSuite.java  |   4 +-
 .../processors/query/GridQueryProcessor.java       |   5 +
 .../processors/query/h2/opt/GridH2Table.java       |  49 ++++
 .../processors/cache/index/BasicIndexTest.java     |   4 +-
 .../query/h2/TableStatisticsAbstractTest.java      |   2 +-
 14 files changed, 464 insertions(+), 41 deletions(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/AbstractIndexScan.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/AbstractIndexScan.java
index 7260e75..00e3a4c 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/AbstractIndexScan.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/AbstractIndexScan.java
@@ -132,15 +132,15 @@ public abstract class AbstractIndexScan extends ProjectableFilterableTableScan {
             cost = 0;
 
             if (lowerCondition() != null) {
-                double selectivity0 = mq.getSelectivity(this, RexUtil.composeDisjunction(builder, lowerCondition()));
+                double selectivity0 = mq.getSelectivity(this, RexUtil.composeConjunction(builder, lowerCondition()));
 
                 selectivity -= 1 - selectivity0;
 
                 cost += Math.log(rows);
             }
 
-            if (upperCondition() != null) {
-                double selectivity0 = mq.getSelectivity(this, RexUtil.composeDisjunction(builder, upperCondition()));
+            if (upperCondition() != null && lowerCondition() != null && !lowerCondition().equals(upperCondition())) {
+                double selectivity0 = mq.getSelectivity(this, RexUtil.composeConjunction(builder, upperCondition()));
 
                 selectivity -= 1 - selectivity0;
             }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTableImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTableImpl.java
index 96cde58..3c874f1 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTableImpl.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTableImpl.java
@@ -45,6 +45,8 @@ import org.apache.ignite.internal.processors.query.calcite.rel.logical.IgniteLog
 import org.apache.ignite.internal.processors.query.calcite.trait.IgniteDistribution;
 import org.apache.ignite.internal.processors.query.calcite.trait.RewindabilityTrait;
 import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeFactory;
+import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
+import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -58,6 +60,9 @@ public class IgniteTableImpl extends AbstractTable implements IgniteTable {
     private final Statistic statistic;
 
     /** */
+    private volatile GridH2Table tbl;
+
+    /** */
     private final Map<String, IgniteIndex> indexes = new ConcurrentHashMap<>();
 
     /**
@@ -75,6 +80,15 @@ public class IgniteTableImpl extends AbstractTable implements IgniteTable {
 
     /** {@inheritDoc} */
     @Override public Statistic getStatistic() {
+        if (tbl == null) {
+            IgniteH2Indexing idx = (IgniteH2Indexing) desc.cacheContext().kernalContext().query().getIndexing();
+
+            final String tblName = desc.typeDescription().tableName();
+            final String schemaName = desc.typeDescription().schemaName();
+
+            tbl = idx.schemaManager().dataTable(schemaName, tblName);
+        }
+
         return statistic;
     }
 
@@ -158,7 +172,9 @@ public class IgniteTableImpl extends AbstractTable implements IgniteTable {
     private class StatisticsImpl implements Statistic {
         /** {@inheritDoc} */
         @Override public Double getRowCount() {
-            return 1000d;  // TODO
+            long rows = tbl.getRowCountApproximationNoCheck();
+
+            return (double)rows;
         }
 
         /** {@inheritDoc} */
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptor.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptor.java
index a7c9723..fc5ae01 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptor.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptor.java
@@ -27,6 +27,7 @@ import org.apache.calcite.util.ImmutableBitSet;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
+import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
 import org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
 import org.apache.ignite.internal.processors.query.calcite.exec.RowHandler;
 import org.apache.ignite.internal.processors.query.calcite.metadata.ColocationGroup;
@@ -142,4 +143,9 @@ public interface TableDescriptor extends RelProtoDataType, InitializerExpression
      * @return Column descriptor
      */
     ColumnDescriptor columnDescriptor(String fieldName);
+
+    /**
+     * @return Type descriptor.
+     */
+    GridQueryTypeDescriptor typeDescription();
 }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptorImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptorImpl.java
index 646cd79..5ec8b73 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptorImpl.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/TableDescriptorImpl.java
@@ -678,4 +678,9 @@ public class TableDescriptorImpl extends NullInitializerExpressionFactory
             desc.setValue(key0, val0, val);
         }
     }
+
+    /** {@inheritDoc} */
+    @Override public GridQueryTypeDescriptor typeDescription() {
+        return typeDesc;
+    }
 }
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteBasicSecondaryIndexIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteBasicSecondaryIndexIntegrationTest.java
index 35e7d33..04fe3d9 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteBasicSecondaryIndexIntegrationTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteBasicSecondaryIndexIntegrationTest.java
@@ -96,6 +96,30 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
         devCache.put(3, new Developer("Bach", 1, "Leipzig", 55));
         devCache.put(4, new Developer("Strauss", 2, "Munich", 66));
 
+        devCache.put(5, new Developer("Vagner", 4, "Leipzig", 70));
+        devCache.put(6, new Developer("Chaikovsky", 5, "Votkinsk", 53));
+        devCache.put(7, new Developer("Verdy", 6, "Rankola", 88));
+        devCache.put(8, new Developer("Stravinsky", 7, "Spt", 89));
+        devCache.put(9, new Developer("Rahmaninov", 8, "Starorussky ud", 70));
+        devCache.put(10, new Developer("Shubert", 9, "Vienna", 31));
+        devCache.put(11, new Developer("Glinka", 10, "Smolenskaya gb", 53));
+
+        devCache.put(12, new Developer("Einaudi", 11, "", -1));
+        devCache.put(13, new Developer("Glass", 12, "", -1));
+        devCache.put(14, new Developer("Rihter", 13, "", -1));
+
+        devCache.put(15, new Developer("Marradi", 14, "", -1));
+        devCache.put(16, new Developer("Zimmer", 15, "", -1));
+        devCache.put(17, new Developer("Hasaishi", 16, "", -1));
+
+        devCache.put(18, new Developer("Arnalds", 17, "", -1));
+        devCache.put(19, new Developer("Yiruma", 18, "", -1));
+        devCache.put(20, new Developer("O'Halloran", 19, "", -1));
+
+        devCache.put(21, new Developer("Cacciapaglia", 20, "", -1));
+        devCache.put(22, new Developer("Prokofiev", 21, "", -1));
+        devCache.put(23, new Developer("Musorgskii", 22, "", -1));
+
         awaitPartitionMapExchange();
     }
 
@@ -118,6 +142,25 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns("Beethoven", "Beethoven")
             .returns("Mozart", "Mozart")
             .returns("Strauss", "Strauss")
+            .returns("Vagner", "Vagner")
+            .returns("Chaikovsky", "Chaikovsky")
+            .returns("Verdy", "Verdy")
+            .returns("Stravinsky", "Stravinsky")
+            .returns("Rahmaninov", "Rahmaninov")
+            .returns("Shubert", "Shubert")
+            .returns("Glinka", "Glinka")
+            .returns("Arnalds", "Arnalds")
+            .returns("Glass", "Glass")
+            .returns("O'Halloran", "O'Halloran")
+            .returns("Prokofiev", "Prokofiev")
+            .returns("Yiruma", "Yiruma")
+            .returns("Cacciapaglia", "Cacciapaglia")
+            .returns("Einaudi", "Einaudi")
+            .returns("Hasaishi", "Hasaishi")
+            .returns("Marradi", "Marradi")
+            .returns("Musorgskii", "Musorgskii")
+            .returns("Rihter", "Rihter")
+            .returns("Zimmer", "Zimmer")
             .check();
     }
 
@@ -133,6 +176,25 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns("Mozart", "Mozart")
             .returns("Strauss", "Strauss")
             .returns("Strauss", "Beethoven")
+            .returns("Vagner", "Vagner")
+            .returns("Chaikovsky", "Chaikovsky")
+            .returns("Verdy", "Verdy")
+            .returns("Stravinsky", "Stravinsky")
+            .returns("Rahmaninov", "Rahmaninov")
+            .returns("Shubert", "Shubert")
+            .returns("Glinka", "Glinka")
+            .returns("Arnalds", "Arnalds")
+            .returns("Glass", "Glass")
+            .returns("O'Halloran", "O'Halloran")
+            .returns("Prokofiev", "Prokofiev")
+            .returns("Yiruma", "Yiruma")
+            .returns("Cacciapaglia", "Cacciapaglia")
+            .returns("Einaudi", "Einaudi")
+            .returns("Hasaishi", "Hasaishi")
+            .returns("Marradi", "Marradi")
+            .returns("Musorgskii", "Musorgskii")
+            .returns("Rihter", "Rihter")
+            .returns("Zimmer", "Zimmer")
             .check();
     }
 
@@ -147,6 +209,25 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(18, "Arnalds", 17, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
             .check();
     }
 
@@ -164,20 +245,34 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
     /** */
     @Test
     public void testKeyColumnGreaterThanFilter() {
-        assertQuery("SELECT * FROM Developer WHERE _key>3")
+        assertQuery("SELECT * FROM Developer WHERE _key>3 and _key<12")
             .matches(containsTableScan("PUBLIC", "DEVELOPER"))
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
     /** */
     @Test
     public void testKeyColumnGreaterThanOrEqualsFilter() {
-        assertQuery("SELECT * FROM Developer WHERE _key>=?")
-            .withParams(3)
+        assertQuery("SELECT * FROM Developer WHERE _key>=? and _key<=?")
+            .withParams(3, 11)
             .matches(containsTableScan("PUBLIC", "DEVELOPER"))
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
@@ -216,20 +311,34 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
     /** */
     @Test
     public void testKeyAliasGreaterThanFilter() {
-        assertQuery("SELECT * FROM Developer WHERE id>?")
-            .withParams(3)
+        assertQuery("SELECT * FROM Developer WHERE id>? and id<?")
+            .withParams(3, 12)
             .matches(containsTableScan("PUBLIC", "DEVELOPER"))
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
     /** */
     @Test
     public void testKeyAliasGreaterThanOrEqualsFilter() {
-        assertQuery("SELECT * FROM Developer WHERE id>=3")
+        assertQuery("SELECT * FROM Developer WHERE id>=3 and id<12")
             .matches(containsTableScan("PUBLIC", "DEVELOPER"))
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
@@ -268,21 +377,20 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
     /** */
     @Test
     public void testIndexedFieldGreaterThanFilter() {
-        assertQuery("SELECT * FROM Developer WHERE depId>2")
+        assertQuery("SELECT * FROM Developer WHERE depId>21")
             .withParams(3)
             .matches(containsIndexScan("PUBLIC", "DEVELOPER", DEPID_IDX))
-            .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(23, "Musorgskii", 22, "", -1)
             .check();
     }
 
     /** */
     @Test
     public void testIndexedFieldGreaterThanOrEqualsFilter() {
-        assertQuery("SELECT * FROM Developer WHERE depId>=2")
+        assertQuery("SELECT * FROM Developer WHERE depId>=21")
             .matches(containsIndexScan("PUBLIC", "DEVELOPER", DEPID_IDX))
-            .returns(1, "Mozart", 3, "Vienna", 33)
-            .returns(2, "Beethoven", 2, "Vienna", 44)
-            .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
             .check();
     }
 
@@ -330,6 +438,12 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .matches(containsTableScan("PUBLIC", "DEVELOPER"))
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
@@ -342,6 +456,12 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .check();
     }
 
@@ -354,6 +474,21 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns(1, "Mozart", 3, "Vienna", 33)
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(3, "Bach", 1, "Leipzig", 55)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(18, "Arnalds", 17, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
             .check();
     }
 
@@ -366,6 +501,21 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns(1, "Mozart", 3, "Vienna", 33)
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(3, "Bach", 1, "Leipzig", 55)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(18, "Arnalds", 17, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
             .check();
     }
 
@@ -449,6 +599,7 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
         assertQuery("SELECT * FROM Developer WHERE name>='Mozart' AND depId>=2 AND city>='Vienna'")
             .matches(containsAnyScan("PUBLIC", "DEVELOPER", NAME_CITY_IDX, NAME_DEPID_CITY_IDX, DEPID_IDX))
             .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(10, "Shubert", 9, "Vienna", 31)
             .check();
     }
 
@@ -458,6 +609,7 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
         assertQuery("SELECT * FROM Developer WHERE name>='Mozart' AND city>='Vienna'")
             .matches(containsAnyScan("PUBLIC", "DEVELOPER", NAME_CITY_IDX, NAME_DEPID_CITY_IDX))
             .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(10, "Shubert", 9, "Vienna", 31)
             .check();
     }
 
@@ -571,6 +723,15 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .check();
     }
 
+    /** */
+    @Test
+    public void testOrCondition5() {
+        assertQuery("SELECT * FROM Developer WHERE depId=1 OR name='Mozart'")
+            .matches(containsUnion(true))
+            .matches(containsIndexScan("PUBLIC", "DEVELOPER", DEPID_IDX))
+            .check();
+    }
+
     // ===== various complex conditions =====
 
     /** */
@@ -613,6 +774,27 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .returns(4, "Strauss", 2, "Munich", 66)
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(18, "Arnalds", 17, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
+
             .ordered()
             .check();
     }
@@ -624,10 +806,29 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
             .matches(containsAnyScan("PUBLIC", "DEVELOPER"))
             .matches(containsAnyScan("PUBLIC", "DEVELOPER"))
             .matches(containsSubPlan("IgniteSort"))
+            .returns(18, "Arnalds", 17, "", -1)
             .returns(3, "Bach", 1, "Leipzig", 55)
             .returns(2, "Beethoven", 2, "Vienna", 44)
-            .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(23, "Musorgskii", 22, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(10, "Shubert", 9, "Vienna", 31)
             .returns(4, "Strauss", 2, "Munich", 66)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
             .ordered()
             .check();
     }
@@ -638,10 +839,29 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
         assertQuery("SELECT * FROM Developer ORDER BY name DESC, city DESC")
             .matches(containsIndexScan("PUBLIC", "DEVELOPER", NAME_CITY_IDX))
             .matches(not(containsSubPlan("IgniteSort")))
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
+            .returns(8, "Stravinsky", 7, "Spt", 89)
             .returns(4, "Strauss", 2, "Munich", 66)
-            .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
+            .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(15, "Marradi", 14, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(21, "Cacciapaglia", 20, "", -1)
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(3, "Bach", 1, "Leipzig", 55)
+            .returns(18, "Arnalds", 17, "", -1)
             .ordered()
             .check();
     }
@@ -652,10 +872,29 @@ public class CalciteBasicSecondaryIndexIntegrationTest extends GridCommonAbstrac
         assertQuery("SELECT * FROM Developer ORDER BY age DESC")
             .matches(containsAnyProject("PUBLIC", "DEVELOPER"))
             .matches(containsSubPlan("IgniteSort"))
+            .returns(8, "Stravinsky", 7, "Spt", 89)
+            .returns(7, "Verdy", 6, "Rankola", 88)
+            .returns(9, "Rahmaninov", 8, "Starorussky ud", 70)
+            .returns(5, "Vagner", 4, "Leipzig", 70)
             .returns(4, "Strauss", 2, "Munich", 66)
             .returns(3, "Bach", 1, "Leipzig", 55)
+            .returns(6, "Chaikovsky", 5, "Votkinsk", 53)
+            .returns(11, "Glinka", 10, "Smolenskaya gb", 53)
             .returns(2, "Beethoven", 2, "Vienna", 44)
             .returns(1, "Mozart", 3, "Vienna", 33)
+            .returns(10, "Shubert", 9, "Vienna", 31)
+            .returns(14, "Rihter", 13, "", -1)
+            .returns(13, "Glass", 12, "", -1)
+            .returns(12, "Einaudi", 11, "", -1)
+            .returns(20, "O'Halloran", 19, "", -1)
+            .returns(23, "Musorgskii", 22, "", -1)
+            .returns(19, "Yiruma", 18, "", -1)
+            .returns(21, "Cacciapaglia", 20, "", -1)
+            .returns(22, "Prokofiev", 21, "", -1)
+            .returns(16, "Zimmer", 15, "", -1)
+            .returns(18, "Arnalds", 17, "", -1)
+            .returns(17, "Hasaishi", 16, "", -1)
+            .returns(15, "Marradi", 14, "", -1)
             .ordered()
             .check();
     }
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
index 3eab309..a68d6e3 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
@@ -45,8 +45,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_EXPERIMENTAL_SQL_ENGINE;
-
 /**
  *
  */
@@ -504,18 +502,6 @@ public class CalciteQueryProcessorTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Temporary redirects create|drop|alter commands into h2 engine.
-     */
-    @Test
-    @WithSystemProperty(key = IGNITE_EXPERIMENTAL_SQL_ENGINE, value = "true")
-    public void testUseH2Functionality() {
-        execute(grid(1), "CREATE TABLE IF NOT EXISTS Person(\"id\" INT, PRIMARY KEY(\"id\"), \"name\" VARCHAR)");
-
-        execute(grid(1), "alter table Person add column age int");
-        execute(grid(1),"drop table Person");
-    }
-
-    /**
      * Execute SQL statement on given node.
      *
      * @param node Node.
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/SqlFieldsQueryUsageTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/SqlFieldsQueryUsageTest.java
new file mode 100644
index 0000000..2546fc2
--- /dev/null
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/SqlFieldsQueryUsageTest.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite;
+
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.QueryEntity;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.testframework.junits.WithSystemProperty;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.AfterClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static java.util.Collections.singletonList;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_EXPERIMENTAL_SQL_ENGINE;
+
+/** */
+@WithSystemProperty(key = IGNITE_EXPERIMENTAL_SQL_ENGINE, value = "true")
+public class SqlFieldsQueryUsageTest extends GridCommonAbstractTest {
+    /** */
+    private static IgniteEx client;
+
+    /** */
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGrids(1);
+
+        client = startClientGrid();
+    }
+
+    /** */
+    @AfterClass
+    public static void tearDown() {
+        G.stopAll(false);
+    }
+
+    /**
+     * Temporary redirects create|drop|alter commands into h2 engine.
+     */
+    @Test
+    public void testUseH2Functionality() {
+        execute(grid(0), "CREATE TABLE IF NOT EXISTS Person(\"id\" INT, PRIMARY KEY(\"id\"), \"name\" VARCHAR)");
+
+        execute(grid(0), "alter table Person add column age int");
+        execute(grid(0), "drop table Person");
+    }
+
+    /** */
+    @Ignore("https://issues.apache.org/jira/browse/IGNITE-14019")
+    @Test
+    public void createCacheOnSrvCallOnCli() {
+        QueryEntity projEntity = new QueryEntity();
+        projEntity.setKeyType(Integer.class.getName());
+        projEntity.setKeyFieldName("id");
+        projEntity.setValueType(Integer.class.getName());
+        projEntity.addQueryField("id", Integer.class.getName(), null);
+        projEntity.addQueryField("depId", Integer.class.getName(), null);
+
+        projEntity.setTableName("Developer");
+
+        CacheConfiguration<Integer, Integer> projCfg =
+            new CacheConfiguration<Integer, Integer>(projEntity.getTableName())
+                .setQueryEntities(singletonList(projEntity))
+                .setSqlSchema("PUBLIC");
+
+        IgniteCache<Integer, Integer> devCache = grid(0).createCache(projCfg);
+
+        assertFalse(grid(0).configuration().isClientMode());
+
+        devCache.put(1, 2);
+
+        assertEquals(1, execute(client, "SELECT * FROM Developer").size());;
+    }
+
+    /**
+     * Execute SQL statement on given node.
+     *
+     * @param node Node.
+     * @param sql Statement.
+     */
+    protected List<List<?>> execute(IgniteEx node, String sql) {
+        return node.context().query().querySqlFields(new SqlFieldsQuery(sql).setSchema("PUBLIC"), true).getAll();
+    }
+}
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/IndexSpoolPlannerTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/IndexSpoolPlannerTest.java
index 05c10b9..f6d1c37 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/IndexSpoolPlannerTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/IndexSpoolPlannerTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.query.calcite.planner;
 
 import java.util.List;
 
-import org.apache.calcite.plan.RelOptUtil;
 import org.apache.calcite.rel.RelCollations;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rex.RexFieldAccess;
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
index d2728ee..3484b7b 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
@@ -108,6 +108,21 @@ public class OrToUnionRuleTest extends GridCommonAbstractTest {
         devCache.put(7, new Product(7, "Video", 1, null, 0, "Canon"));
         devCache.put(8, new Product(8, null, 0, "Camera Lens", 11, "Zeiss"));
         devCache.put(9, new Product(9, null, 0, null, 0, null));
+        devCache.put(10, new Product(10, null, 0, null, 30, null));
+        devCache.put(11, new Product( 11, null, 0, null, 30, null));
+        devCache.put(12, new Product( 12, null, 0, null, 31, null));
+        devCache.put(13, new Product( 13, null, 0, null, 31, null));
+
+        devCache.put(14, new Product( 14, null, 0, null, 32, null));
+        devCache.put(15, new Product( 15, null, 0, null, 33, null));
+        devCache.put(16, new Product( 16, null, 0, null, 34, null));
+        devCache.put(17, new Product( 17, null, 0, null, 35, null));
+        devCache.put(18, new Product( 18, null, 0, null, 36, null));
+        devCache.put(19, new Product( 19, null, 0, null, 37, null));
+        devCache.put(20, new Product( 20, null, 0, null, 38, null));
+        devCache.put(21, new Product( 21, null, 0, null, 39, null));
+        devCache.put(22, new Product( 22, null, 0, null, 40, null));
+        devCache.put(23, new Product( 23, null, 0, null, 41, null));
 
         awaitPartitionMapExchange();
     }
@@ -204,14 +219,13 @@ public class OrToUnionRuleTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     @Test
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-12819")
     public void testNonIndexedOrToUnionAllRewrite() throws Exception {
         checkQuery("SELECT * " +
             "FROM products " +
             "WHERE name = 'Canon' " +
             "OR category = 'Video'")
-            .matches(not(containsUnion(true)))
-            .matches(containsIndexScan("PUBLIC", "PRODUCTS", "PK"))
+            .matches(containsUnion(true))
+            .matches(containsIndexScan("PUBLIC", "PRODUCTS", "IDX_CATEGORY"))
             .returns(5, "Video", 2, "Camera Media", 21, "Media 3")
             .returns(6, "Video", 2, "Camera Lens", 22, "Lens 3")
             .returns(7, "Video", 1, null, 0, "Canon")
@@ -224,7 +238,6 @@ public class OrToUnionRuleTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     @Test
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-12819")
     public void testAllNonIndexedOrToUnionAllRewrite() throws Exception {
         checkQuery("SELECT * " +
             "FROM products " +
diff --git a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
index a372500..32197f2 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.processors.query.calcite.CancelTest;
 import org.apache.ignite.internal.processors.query.calcite.DateTimeTest;
 import org.apache.ignite.internal.processors.query.calcite.LimitOffsetTest;
 import org.apache.ignite.internal.processors.query.calcite.QueryCheckerTest;
+import org.apache.ignite.internal.processors.query.calcite.SqlFieldsQueryUsageTest;
 import org.apache.ignite.internal.processors.query.calcite.exec.ClosableIteratorsHolderTest;
 import org.apache.ignite.internal.processors.query.calcite.exec.rel.ContinuousExecutionTest;
 import org.apache.ignite.internal.processors.query.calcite.jdbc.JdbcQueryTest;
@@ -48,7 +49,8 @@ import org.junit.runners.Suite;
     CancelTest.class,
     QueryCheckerTest.class,
     DateTimeTest.class,
-    LimitOffsetTest.class
+    LimitOffsetTest.class,
+    SqlFieldsQueryUsageTest.class
 })
 public class IgniteCalciteTestSuite {
 }
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 1fb7774..0e1f602 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -2871,6 +2871,11 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         });
     }
 
+    /** Calcite baseb engine is available. */
+    public boolean useExperimentalEngine() {
+        return experimentalQueryEngine != null;
+    }
+
     /**
      * @param cctx Cache context.
      * @param qry Query.
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index 290e82a..39e1735 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.LongAdder;
@@ -45,6 +46,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheContextInfo;
 import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
 import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
 import org.apache.ignite.internal.processors.cache.query.QueryTable;
+import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.QueryField;
 import org.apache.ignite.internal.processors.query.QueryUtils;
@@ -112,6 +114,12 @@ public class GridH2Table extends TableBase {
      */
     private static final double STATS_UPDATE_THRESHOLD = 0.1; // 10%.
 
+    /** */
+    private static final int STATS_CLI_UPDATE_THRESHOLD = 200;
+
+    /** */
+    AtomicInteger cliReqCnt = new AtomicInteger();
+
     /** Cache context info. */
     private final GridCacheContextInfo cacheInfo;
 
@@ -1242,6 +1250,13 @@ public class GridH2Table extends TableBase {
         return tblStats.primaryRowCount();
     }
 
+    /** */
+    public long getRowCountApproximationNoCheck() {
+        refreshStatsIfNeededEx();
+
+        return tblStats.primaryRowCount();
+    }
+
     /**
      * @param qctx Context.
      *
@@ -1275,6 +1290,40 @@ public class GridH2Table extends TableBase {
     }
 
     /**
+     * Refreshes table stats if they are possibly outdated, must be called only in client mode.
+     */
+    private void refreshStatsIfNeededEx() {
+        boolean client = cacheInfo.cacheContext().kernalContext().clientNode();
+
+        GridQueryProcessor qryProc = cacheInfo.cacheContext().kernalContext().query();
+        boolean experimental = qryProc.useExperimentalEngine();
+
+        assert experimental;
+
+        if (!client) {
+            refreshStatsIfNeeded();
+
+            return;
+        }
+
+        // Update stats if total table size changed significantly since the last stats update.
+        if (cliReqCnt.getAndIncrement() % STATS_CLI_UPDATE_THRESHOLD == 0) {
+            TableStatistics stats = tblStats;
+
+            long primaryRowCnt = stats.primaryRowCount();
+
+            try {
+                primaryRowCnt = cacheInfo.cacheContext().cache().size(new CachePeekMode[] {CachePeekMode.PRIMARY});
+            }
+            catch (IgniteCheckedException e) {
+                log.warning("Can`t update cache size.", e);
+            }
+
+            tblStats = new TableStatistics(stats.totalRowCount(), primaryRowCnt);
+        }
+    }
+
+    /**
      * @param statsRowCnt Row count from statistics.
      * @param actualRowCnt Actual row count.
      * @return {@code True} if actual table size has changed more than the threshold since last stats update.
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java
index 9673af8..05e0de7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java
@@ -106,9 +106,9 @@ public class BasicIndexTest extends AbstractIndexingCommonTest {
         igniteCfg.setConsistentId(igniteInstanceName);
 
         if (igniteInstanceName.startsWith(CLIENT_NAME) && clientLog != null)
-                igniteCfg.setGridLogger(clientLog);
+            igniteCfg.setGridLogger(clientLog);
         else if (srvLog != null)
-                igniteCfg.setGridLogger(srvLog);
+            igniteCfg.setGridLogger(srvLog);
 
         LinkedHashMap<String, String> fields = new LinkedHashMap<>();
         fields.put("keyStr", String.class.getName());
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/TableStatisticsAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/TableStatisticsAbstractTest.java
index 44b0695..ff7b7d6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/TableStatisticsAbstractTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/TableStatisticsAbstractTest.java
@@ -76,7 +76,7 @@ public abstract class TableStatisticsAbstractTest extends GridCommonAbstractTest
      *
      * Actual scan row count is obtained from the EXPLAIN ANALYZE command result.
      */
-    private void ensureOptimalPlanChosen(Ignite grid, String sql, String... tbls) {
+    private void ensureOptimalPlanChosen(Ignite grid, String sql) {
         int cntNoStats = runLocalExplainAnalyze(grid, true, sql);
 
         int cntStats = runLocalExplainAnalyze(grid, false, sql);