Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4964

ORDER BY should use a LOCAL index even if the query is not fully covered

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.15.0, 4.14.1, 5.1.0
    • None
    • None

    Description

      I just noticed that a query like
      SELECT <column1> FROM <table> ORDER BY <column2> LIMIT <n>

      Does not use an index on <column2> if it does not also include <column1>. That seems too limited.
      I can see the code in QueryOptimizer.addPlan that rewrites the plan only when there's a WHERE clause, and then only for the WHERE clause.

      Attachments

        1. PHOENIX-4964-4.x-HBase-1.4.txt
          1.0 kB
          Lars Hofhansl
        2. PHOENIX-4964-4.x-HBase-1.4.v2.txt
          2 kB
          Lars Hofhansl
        3. PHOENIX-4964-4.x-HBase-1.4.v3.txt
          4 kB
          Lars Hofhansl
        4. PHOENIX-4964-4.x-HBase-1.4.v4.txt
          5 kB
          Lars Hofhansl

        Issue Links

          Activity

            People

              larsh Lars Hofhansl
              larsh Lars Hofhansl
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: