Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-4150

B-Tree index cannot be used efficiently with IN clause.

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7
    • 2.7
    • sql
    • Docs Required

    Description

      Consider the following query:

      SELECT * FROM table
      WHERE a = ? AND b IN (?, ?)
      

      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.

      Attachments

        Issue Links

          Activity

            People

              tledkov-gridgain Taras Ledkov
              vozerov Vladimir Ozerov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: