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

Query limit not enforced in UncoveredIndexRegionScanner

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.2.0, 5.1.3
    • 5.2.0, 5.1.4
    • None
    • None

    Description

      If the select query specifies a limit, the limit is available as a scan attribute BaseScannerRegionObserver.INDEX_LIMIT (https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java#L154). However, that limit is not enforced on the page size used in the UncoveredIndexRegionScanner. It continues to use the page size based on the config phoenix.index.page_size_in_rows
      This results in doing extra work in reading the index rows and then joining them with the data table only to be thrown away. Set the page size to be the smaller of the configured size and the query limit if provided.

      Another thing I found was that the explain plan when the uncovered index is used doesn't list the plan step "SERVER <> ROW LIMIT"

      Attachments

        Issue Links

          Activity

            People

              tkhurana Tanuj Khurana
              tkhurana Tanuj Khurana
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: