You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2023/09/14 08:22:08 UTC

[ignite-extensions] branch master updated: IGNITE-20079 Process additional performance statistics info for queries - Fixes #225.

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

alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git


The following commit(s) were added to refs/heads/master by this push:
     new d8ed2e57 IGNITE-20079 Process additional performance statistics info for queries - Fixes #225.
d8ed2e57 is described below

commit d8ed2e57e9b89e1ef01c29c8b013dcc4f4e87683
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Thu Sep 14 11:13:55 2023 +0300

    IGNITE-20079 Process additional performance statistics info for queries - Fixes #225.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 .../performance-statistics-ext/report/js/sqlTab.js |  95 +++++++++-
 .../IgnitePerformanceStatisticsHandler.java        |  24 +++
 .../handlers/PrintHandler.java                     |  58 +++++++
 .../handlers/QueryHandler.java                     | 192 ++++++++++++++++++---
 .../PerformanceStatisticsPrinterTest.java          |   6 +-
 .../PerformanceStatisticsReportSelfTest.java       |   6 +-
 6 files changed, 354 insertions(+), 27 deletions(-)

diff --git a/modules/performance-statistics-ext/report/js/sqlTab.js b/modules/performance-statistics-ext/report/js/sqlTab.js
index c69b235d..70b2b9c8 100644
--- a/modules/performance-statistics-ext/report/js/sqlTab.js
+++ b/modules/performance-statistics-ext/report/js/sqlTab.js
@@ -44,6 +44,12 @@ $('#sqlStatisticsTable').bootstrapTable({
         sortable: true
     }],
     data: prepareSqlTableData(),
+    detailViewIcon: true,
+    detailViewByClick: true,
+    detailView: true,
+    onExpandRow: function (index, row, $detail) {
+        buildExpandDetails(row, $detail)
+    },
     sortName: 'duration',
     sortOrder: 'desc'
 });
@@ -58,7 +64,9 @@ function prepareSqlTableData() {
             "duration": sqlData["duration"],
             "logicalReads": sqlData["logicalReads"],
             "physicalReads": sqlData["physicalReads"],
-            "failures": sqlData["failures"]
+            "failures": sqlData["failures"],
+            "properties": sqlData["properties"],
+            "rows": sqlData["rows"]
         });
     });
 
@@ -99,6 +107,12 @@ $('#topSlowSqlTable').bootstrapTable({
         sortable: true
     }],
     data: prepareSlowSqlTableData(),
+    detailViewIcon: true,
+    detailViewByClick: true,
+    detailView: true,
+    onExpandRow: function (index, row, $detail) {
+        buildExpandDetails(row, $detail)
+    },
     sortName: 'duration',
     sortOrder: 'desc'
 });
@@ -114,9 +128,86 @@ function prepareSlowSqlTableData() {
             nodeId: sqlData["nodeId"],
             logicalReads: sqlData["logicalReads"],
             physicalReads: sqlData["physicalReads"],
-            success: sqlData["success"]
+            success: sqlData["success"],
+            properties: sqlData["properties"],
+            rows: sqlData["rows"]
         });
     });
 
     return data;
 }
+
+/** Builds details on expand row. */
+function buildExpandDetails(row, $detail) {
+    var hasProperties = row.hasOwnProperty("properties")
+    var hasRows = row.hasOwnProperty("rows")
+    var htmlProperties = hasProperties ? "<h5>Properties</h5><table class='properties'></table>" : ""
+    var htmlRows = hasRows ? "<h5>Rows</h5><table class='rows'></table>" : ""
+
+    var html = $detail.html(htmlProperties + (hasProperties & hasRows ? "<br/>" : "") + htmlRows)
+
+    if (hasProperties)
+        buildPropertiesSubTable(html.find('table.properties'), row.properties)
+
+    if (hasRows)
+        buildRowsSubTable(html.find('table.rows'), row.rows)
+}
+
+/** Builds query properties subtable. */
+function buildPropertiesSubTable($el, properties) {
+    var data = [];
+
+    $.each(properties, function (k, prop) {
+        data.push({
+            name: k,
+            value: prop["value"],
+            count: prop["count"]
+        });
+    });
+
+    $el.bootstrapTable({
+        columns: [{
+            field: 'name',
+            title: 'Property name',
+            sortable: true
+        }, {
+            field: 'value',
+            title: 'Property value',
+            sortable: true
+        }, {
+            field: 'count',
+            title: 'Count',
+            sortable: true
+        }],
+        data: data,
+        sortName: 'name',
+        sortOrder: 'asc'
+    })
+}
+
+/** Builds query rows subtable. */
+function buildRowsSubTable($el, rows) {
+    var data = [];
+
+    $.each(rows, function (k, row) {
+        data.push({
+            action: k,
+            rows: row
+        });
+    });
+
+    $el.bootstrapTable({
+        columns: [{
+            field: 'action',
+            title: 'Action',
+            sortable: true
+        }, {
+            field: 'rows',
+            title: 'Rows count',
+            sortable: true
+        }],
+        data: data,
+        sortName: 'action',
+        sortOrder: 'asc'
+    })
+}
diff --git a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/IgnitePerformanceStatisticsHandler.java b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/IgnitePerformanceStatisticsHandler.java
index 5660ef39..7cfeddf2 100644
--- a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/IgnitePerformanceStatisticsHandler.java
+++ b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/IgnitePerformanceStatisticsHandler.java
@@ -89,4 +89,28 @@ public interface IgnitePerformanceStatisticsHandler extends PerformanceStatistic
     @Override default void pagesWriteThrottle(UUID nodeId, long endTime, long duration) {
         // No-op.
     }
+
+    /** {@inheritDoc} */
+    @Override default void queryRows(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String action,
+        long rows
+    ) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override default void queryProperty(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String name,
+        String val
+    ) {
+        // No-op.
+    }
 }
diff --git a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/PrintHandler.java b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/PrintHandler.java
index 53c10e15..c0086530 100644
--- a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/PrintHandler.java
+++ b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/PrintHandler.java
@@ -35,7 +35,9 @@ import static org.apache.ignite.internal.processors.performancestatistics.Operat
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.JOB;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.PAGES_WRITE_THROTTLE;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY;
+import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_PROPERTY;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_READS;
+import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_ROWS;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TASK;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TX_COMMIT;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TX_ROLLBACK;
@@ -174,6 +176,62 @@ public class PrintHandler implements PerformanceStatisticsHandler {
         ps.println("}");
     }
 
+    /** {@inheritDoc} */
+    @Override public void queryRows(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String action,
+        long rows
+    ) {
+        if (skip(QUERY_ROWS))
+            return;
+
+        ps.print("{\"op\":\"" + QUERY_ROWS);
+        ps.print("\",\"nodeId\":\"");
+        ps.print(nodeId);
+        ps.print("\",\"type\":\"");
+        ps.print(type);
+        ps.print("\",\"queryNodeId\":\"");
+        ps.print(qryNodeId);
+        ps.print("\",\"id\":");
+        ps.print(id);
+        ps.print(",\"action\":\"");
+        printEscaped(ps, action);
+        ps.print("\",\"rows\":");
+        ps.print(rows);
+        ps.println("}");
+    }
+
+    /** {@inheritDoc} */
+    @Override public void queryProperty(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String name,
+        String val
+    ) {
+        if (skip(QUERY_PROPERTY))
+            return;
+
+        ps.print("{\"op\":\"" + QUERY_PROPERTY);
+        ps.print("\",\"nodeId\":\"");
+        ps.print(nodeId);
+        ps.print("\",\"type\":\"");
+        ps.print(type);
+        ps.print("\",\"queryNodeId\":\"");
+        ps.print(qryNodeId);
+        ps.print("\",\"id\":");
+        ps.print(id);
+        ps.print(",\"name\":\"");
+        printEscaped(ps, name);
+        ps.print("\",\"val\":\"");
+        printEscaped(ps, val);
+        ps.println("\"}");
+    }
+
     /** {@inheritDoc} */
     @Override public void task(UUID nodeId, IgniteUuid sesId, String taskName, long startTime, long duration,
         int affPartId) {
diff --git a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/QueryHandler.java b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/QueryHandler.java
index 1406791a..5153b734 100644
--- a/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/QueryHandler.java
+++ b/modules/performance-statistics-ext/src/main/java/org/apache/ignite/internal/performancestatistics/handlers/QueryHandler.java
@@ -17,11 +17,13 @@
 
 package org.apache.ignite.internal.performancestatistics.handlers;
 
+import java.util.Collection;
 import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeMap;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -29,6 +31,8 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.ignite.internal.performancestatistics.util.OrderedFixedSizeStructure;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T3;
 
 import static org.apache.ignite.internal.performancestatistics.util.Utils.MAPPER;
 
@@ -43,7 +47,15 @@ import static org.apache.ignite.internal.performancestatistics.util.Utils.MAPPER
  *          "duration" : $duration,
  *          "logicalReads" : $logicalReads,
  *          "physicalReads" : $physicalReads,
- *          "failures" : $failures
+ *          "failures" : $failures,
+ *          "properties" : {
+ *              $propName : {"value" : $propValue, "count" : $propCount},
+ *              ...
+ *          },
+ *          "rows" : {
+ *              $action : $rowsCount,
+ *              ...
+ *          }
  *      }
  * }
  * </pre>
@@ -57,7 +69,15 @@ import static org.apache.ignite.internal.performancestatistics.util.Utils.MAPPER
  *      "nodeId" : $nodeId,
  *      "logicalReads" : $logicalReads,
  *      "physicalReads" : $physicalReads,
- *      "success" : $success
+ *      "success" : $success,
+ *      "properties" : {
+ *          $propName : {"value" : $propValue, "count" : $propCount},
+ *          ...
+ *      },
+ *      "rows" : {
+ *          $action : $rowsCount,
+ *          ...
+ *      }
  *  }
  * ]
  * </pre>
@@ -71,6 +91,12 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
     private final Map<GridCacheQueryType, Map<UUID, Map<Long, long[]>>> readsById =
         new EnumMap<>(GridCacheQueryType.class);
 
+    /** Parsed SQL query rows: queryNodeId -> queryId -> action -> rows. */
+    private final Map<UUID, Map<Long, Map<String, long[]>>> rowsById = new HashMap<>();
+
+    /** Parsed SQL query properties: queryNodeId -> queryId -> property name + value -> property. */
+    private final Map<UUID, Map<Long, Map<String, T3<String, String, long[]>>>> propsById = new HashMap<>();
+
     /** Structure to store top of slow SQL queries: queryType -> duration -> query. */
     private final Map<GridCacheQueryType, OrderedFixedSizeStructure<Long, Query>> topSlow =
         new EnumMap<>(GridCacheQueryType.class);
@@ -104,6 +130,40 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
         readsArr[1] += physicalReads;
     }
 
+    /** {@inheritDoc} */
+    @Override public void queryRows(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String action,
+        long rows
+    ) {
+        Map<String, long[]> actions = rowsById.computeIfAbsent(qryNodeId, node -> new HashMap<>())
+            .computeIfAbsent(id, qryId -> new HashMap<>());
+
+        long[] rowsArr = actions.computeIfAbsent(action, act -> new long[] {0});
+
+        rowsArr[0] += rows;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void queryProperty(
+        UUID nodeId,
+        GridCacheQueryType type,
+        UUID qryNodeId,
+        long id,
+        String name,
+        String val
+    ) {
+        Map<String, T3<String, String, long[]>> props = propsById.computeIfAbsent(qryNodeId, node -> new HashMap<>())
+            .computeIfAbsent(id, qryId -> new HashMap<>());
+
+        T3<String, String, long[]> prop = props.computeIfAbsent(name + '=' + val, nv -> new T3<>(name, val, new long[] {0}));
+
+        prop.get3()[0]++;
+    }
+
     /** {@inheritDoc} */
     @Override public Map<String, JsonNode> results() {
         ObjectNode sqlRes = MAPPER.createObjectNode();
@@ -143,20 +203,51 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
 
         res.forEach((text, info) -> {
             info.ids.forEach((uuid, ids) -> {
-                if (!readsById.containsKey(type) || !readsById.get(type).containsKey(uuid))
-                    return;
-
-                Map<Long, long[]> reads = readsById.get(type).get(uuid);
-
-                ids.forEach(id -> {
-                    long[] readsArr = reads.get(id);
-
-                    if (readsArr == null)
-                        return;
-
-                    info.logicalReads += readsArr[0];
-                    info.physicalReads += readsArr[1];
-                });
+                if (readsById.containsKey(type) && readsById.get(type).containsKey(uuid)) {
+                    Map<Long, long[]> reads = readsById.get(type).get(uuid);
+
+                    ids.forEach(id -> {
+                        long[] readsArr = reads.get(id);
+
+                        if (readsArr != null) {
+                            info.logicalReads += readsArr[0];
+                            info.physicalReads += readsArr[1];
+                        }
+                    });
+                }
+
+                if (type == GridCacheQueryType.SQL_FIELDS) {
+                    Map<Long, Map<String, long[]>> nodeRows = rowsById.get(uuid);
+                    Map<Long, Map<String, T3<String, String, long[]>>> nodeProps = propsById.get(uuid);
+
+                    ids.forEach(id -> {
+                        Map<String, T3<String, String, long[]>> qryProps = nodeProps == null ? null : nodeProps.get(id);
+
+                        if (!F.isEmpty(qryProps)) {
+                            qryProps.forEach((propKey0, prop0) -> info.props.compute(propKey0, (propKey1, prop1) -> {
+                                if (prop1 == null)
+                                    return new T3<>(prop0.get1(), prop0.get2(), new long[] {prop0.get3()[0]});
+                                else {
+                                    prop1.get3()[0] += prop0.get3()[0];
+                                    return prop1;
+                                }
+                            }));
+                        }
+
+                        Map<String, long[]> qryRows = nodeRows == null ? null : nodeRows.get(id);
+
+                        if (!F.isEmpty(qryRows)) {
+                            qryRows.forEach((act0, rows0) -> info.rows.compute(act0, (act1, rows1) -> {
+                                if (rows1 == null)
+                                    return new long[] {rows0[0]};
+                                else {
+                                    rows1[0] += rows0[0];
+                                    return rows1;
+                                }
+                            }));
+                        }
+                    });
+                }
             });
 
             ObjectNode sql = (ObjectNode)jsonRes.get(text);
@@ -170,6 +261,29 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
                 sql.put("physicalReads", info.physicalReads);
                 sql.put("failures", info.failures);
 
+                if (!F.isEmpty(info.props)) {
+                    ObjectNode node = MAPPER.createObjectNode();
+
+                    info.props.forEach((propKey, prop) -> {
+                        ObjectNode valCntNode = MAPPER.createObjectNode();
+
+                        valCntNode.put("value", prop.get2());
+                        valCntNode.put("count", prop.get3()[0]);
+
+                        node.putIfAbsent(prop.get1(), valCntNode);
+                    });
+
+                    sql.putIfAbsent("properties", node);
+                }
+
+                if (!F.isEmpty(info.rows)) {
+                    ObjectNode node = MAPPER.createObjectNode();
+
+                    info.rows.forEach((action, cnt) -> node.put(action, cnt[0]));
+
+                    sql.putIfAbsent("rows", node);
+                }
+
                 jsonRes.set(text, sql);
             }
         });
@@ -195,16 +309,42 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
 
             jsonRes.add(json);
 
-            if (!readsById.containsKey(type) || !readsById.get(type).containsKey(query.queryNodeId))
-                return;
+            if (readsById.containsKey(type) && readsById.get(type).containsKey(query.queryNodeId)) {
+                long[] readsArr = readsById.get(type).get(query.queryNodeId).get(query.id);
+
+                if (readsArr != null) {
+                    json.put("logicalReads", readsArr[0]);
+                    json.put("physicalReads", readsArr[1]);
+                }
+            }
+
+            if (type == GridCacheQueryType.SQL_FIELDS) {
+                if (propsById.containsKey(query.queryNodeId) && propsById.get(query.queryNodeId).containsKey(query.id)) {
+                    ObjectNode node = MAPPER.createObjectNode();
 
-            long[] readsArr = readsById.get(type).get(query.queryNodeId).get(query.id);
+                    Collection<T3<String, String, long[]>> props = propsById.get(query.queryNodeId).get(query.id).values();
 
-            if (readsArr == null)
-                return;
+                    props.forEach(prop -> {
+                        ObjectNode valCntNode = MAPPER.createObjectNode();
+                        valCntNode.put("value", prop.get2());
+                        valCntNode.put("count", prop.get3()[0]);
 
-            json.put("logicalReads", readsArr[0]);
-            json.put("physicalReads", readsArr[1]);
+                        node.putIfAbsent(prop.get1(), valCntNode);
+                    });
+
+                    json.putIfAbsent("properties", node);
+                }
+
+                if (rowsById.containsKey(query.queryNodeId) && rowsById.get(query.queryNodeId).containsKey(query.id)) {
+                    ObjectNode node = MAPPER.createObjectNode();
+
+                    Map<String, long[]> rows = rowsById.get(query.queryNodeId).get(query.id);
+
+                    rows.forEach((action, rowsCnt) -> node.put(action, rowsCnt[0]));
+
+                    json.putIfAbsent("rows", node);
+                }
+            }
         });
     }
 
@@ -225,6 +365,12 @@ public class QueryHandler implements IgnitePerformanceStatisticsHandler {
         /** Failures count. */
         int failures;
 
+        /** Aggregated query properties. */
+        Map<String, T3<String, String, long[]>> props = new TreeMap<>();
+
+        /** Number of processed rows (by different actions). */
+        Map<String, long[]> rows = new TreeMap<>();
+
         /** Query ids. Parsed from global query id: NodeId -> queryIds */
         final Map<UUID, Set<Long>> ids = new HashMap<>();
 
diff --git a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsPrinterTest.java b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsPrinterTest.java
index 8e5e3a37..33809bbc 100644
--- a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsPrinterTest.java
+++ b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsPrinterTest.java
@@ -52,7 +52,9 @@ import static org.apache.ignite.internal.processors.performancestatistics.Operat
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.JOB;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.PAGES_WRITE_THROTTLE;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY;
+import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_PROPERTY;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_READS;
+import static org.apache.ignite.internal.processors.performancestatistics.OperationType.QUERY_ROWS;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TASK;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TX_COMMIT;
 import static org.apache.ignite.internal.processors.performancestatistics.OperationType.TX_ROLLBACK;
@@ -90,6 +92,8 @@ public class PerformanceStatisticsPrinterTest {
             writer.transaction(GridIntList.asList(0), 0, 0, false);
             writer.query(GridCacheQueryType.SQL_FIELDS, "query", 0, 0, 0, true);
             writer.queryReads(GridCacheQueryType.SQL_FIELDS, NODE_ID, 0, 0, 0);
+            writer.queryProperty(GridCacheQueryType.SQL_FIELDS, NODE_ID, 0, "name", "val");
+            writer.queryRows(GridCacheQueryType.SQL_FIELDS, NODE_ID, 0, "action", 0);
             writer.task(new IgniteUuid(NODE_ID, 0), "task", 0, 0, 0);
             writer.job(new IgniteUuid(NODE_ID, 0), 0, 0, 0, true);
             writer.checkpoint(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
@@ -97,7 +101,7 @@ public class PerformanceStatisticsPrinterTest {
         });
 
         List<OperationType> expOps = F.asList(CACHE_START, CACHE_GET, TX_COMMIT, TX_ROLLBACK, QUERY, QUERY_READS,
-            TASK, JOB, CHECKPOINT, PAGES_WRITE_THROTTLE);
+            QUERY_PROPERTY, QUERY_ROWS, TASK, JOB, CHECKPOINT, PAGES_WRITE_THROTTLE);
 
         checkOperationFilter(null, expOps);
         checkOperationFilter(F.asList(CACHE_START), F.asList(CACHE_START));
diff --git a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
index 6b5754d6..059913f5 100644
--- a/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
+++ b/modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsReportSelfTest.java
@@ -59,8 +59,10 @@ public class PerformanceStatisticsReportSelfTest {
 
             IgniteCache<Object, Object> cache = client.createCache(new CacheConfiguration<>("cache")
                 .setQueryEntities(F.asList(new QueryEntity()
+                    .setKeyType(Integer.class.getName())
                     .setValueType(Integer.class.getName()))));
 
+            cache.put(0, 0);
             cache.put(1, 1);
             cache.get(1);
             cache.remove(1);
@@ -91,7 +93,9 @@ public class PerformanceStatisticsReportSelfTest {
 
             cache.query(new ScanQuery<>((key, val) -> true)).getAll();
 
-            cache.query(new SqlFieldsQuery("select * from sys.tables")).getAll();
+            cache.query(new SqlFieldsQuery("select * from sys.tables").setEnforceJoinOrder(true)).getAll();
+
+            cache.query(new SqlFieldsQuery("select sum(_VAL) from \"cache\".Integer")).getAll();
 
             cache.query(new IndexQuery<>(Integer.class).setCriteria(gt("_KEY", 0))).getAll();