ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ozerov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-4150) B-Tree index cannot be used efficiently with IN clause.
Date Tue, 03 Jan 2017 07:07:58 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-4150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vladimir Ozerov updated IGNITE-4150:
------------------------------------
    Description: 
Consider the following query:
{code}
SELECT * FROM table
WHERE a = ? AND b IN (?, ?)
{code}

If there is an index {{(a, b)}}, it will not be used properly: only column {{a}} will be used.
This will leads to multiple unnecessary comparisons.

Most obvious way to fix that - use temporary table and {{JOIN}}. However, this approach doesn't
work well when there are multiple {{IN}}'s. 

Proper solution would be to hack deeper into H2.

  was:
Consider the following query:
{code}
SELECT * FROM table
WHERE a = ? AND b IN (?, ?)
{code}

If there is an index {{(a, b)}}, it will not be used properly: only column {{a}} will be used.
This will leads to multiple unnecessary comparisons.

Most obvious way to fix that - use temporary table and {{JOIN}}. However, this approach doesn't
work well when there are multiple {{IN}}s. 

Proper solution would be to hack deeper into H2.


> B-Tree index cannot be used efficiently with IN clause.
> -------------------------------------------------------
>
>                 Key: IGNITE-4150
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4150
>             Project: Ignite
>          Issue Type: Task
>          Components: SQL
>    Affects Versions: 1.7
>            Reporter: Vladimir Ozerov
>              Labels: performance
>             Fix For: 2.0
>
>
> Consider the following query:
> {code}
> SELECT * FROM table
> WHERE a = ? AND b IN (?, ?)
> {code}
> If there is an index {{(a, b)}}, it will not be used properly: only column {{a}} will
be used. This will leads to multiple unnecessary comparisons.
> Most obvious way to fix that - use temporary table and {{JOIN}}. However, this approach
doesn't work well when there are multiple {{IN}}'s. 
> Proper solution would be to hack deeper into H2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message