You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2022/04/30 16:17:00 UTC

[jira] [Created] (IGNITE-16919) Index cost function must take into account only corresponding columns.

Evgeny Stanilovsky created IGNITE-16919:
-------------------------------------------

             Summary: Index cost function must take into account only corresponding columns.
                 Key: IGNITE-16919
                 URL: https://issues.apache.org/jira/browse/IGNITE-16919
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.13
            Reporter: Evgeny Stanilovsky
            Assignee: Evgeny Stanilovsky
         Attachments: image-2022-04-30-19-13-59-997.png

H2IndexCostedBase#getCostRangeIndex is called with allColumnsSet where consists columns from all operating tables, check: 
org.h2.table.Plan#calculateCost :

{code:java}
        final HashSet<Column> allColumnsSet = ExpressionVisitor
                .allColumnsForTableFilters(allFilters);
{code}

thus allColumnsSet consist columns from all operating tables
 !image-2022-04-30-19-13-59-997.png! 
and erroneous iteration here:
H2IndexCostedBase#getCostRangeIndex
...

{code:java}
if (!isScanIndex && allColumnsSet != null && !skipColumnsIntersection && !allColumnsSet.isEmpty()) {
            boolean foundAllColumnsWeNeed = true;

            for (Column c : allColumnsSet) { // <-- all columns
{code}




--
This message was sent by Atlassian Jira
(v8.20.7#820007)