Andrew Kyle Purtell created PHOENIX-8050:
--------------------------------------------

             Summary: Highly selective queries can severely underreport scan 
metrics
                 Key: PHOENIX-8050
                 URL: https://issues.apache.org/jira/browse/PHOENIX-8050
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 5.3.2
            Reporter: Andrew Kyle Purtell
            Assignee: Andrew Kyle Purtell
             Fix For: 5.4.0, 5.3.3


Top-N and offset scanners pre-read rows at initialization, recording their scan 
metrics in a local context intended for HBase's RPC response. {{next()}} checks 
{{isFilterDone()}} before merging this local context into the active RPC 
context, so if all rows in a region are filtered out during scanner setup, 
{{next()}} exits immediately, discarding those initialization metrics before 
they can be recorded.

As a result, queries that filter out entire regions severely underreport scan 
metrics such as {{ROWS_SCANNED}} and {{{}ROWS_FILTERED{}}}.

The fix flushes the initialization metrics into the RPC context before checking 
{{{}isFilterDone(){}}}. This ensures scan metrics accounting is accurate across 
empty regions while preserving early-exit behavior and query results.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to