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
- links to