[ 
https://issues.apache.org/jira/browse/PHOENIX-4437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297962#comment-16297962
 ] 

Maryann Xue commented on PHOENIX-4437:
--------------------------------------

bq. Can you add a comment here on when optimize will not be called? I guess 
it's not being called when you ask the plan for the estimated bytes that will 
be scanned?
Yes, sure. optimize() is for {{QueryPlan}} only, and we cannot call optimize() 
on a {{MutationPlan}} as used by UPSERT or DELETE. In fact, the compilation of 
UPSERT and DELETE has already optimized their enclosed {{QueryPlan}}s. Thus, 
here, we only can and only need to call optimize() for {{QueryPlan}}s.

bq. Do you think it's worth adding some tests, or do you think we have good 
test coverage from your prior check-in (and those are exercising this new code 
path)?
All those test cases that check the explain-plan cover this change, in addition 
to {{ExplainPlanWithStatsEnabledIT}} and the newly added 
{{CostBasedDecisionIT}}. In fact, PHOENIX-1556 was blocked by this issue, as it 
would have infinite loops caused by this incorrect calling logic between 
getExplainPlan() and optimize(). So PHOENIX-1556 will further add to the 
coverage of this change.

> Make QueryPlan.getEstimatedBytesToScan() independent of getExplainPlan() and 
> pull optimize() out of getExplainPlan()
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4437
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4437
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.11.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>         Attachments: PHOENIX-4437.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to