[
https://issues.apache.org/jira/browse/PHOENIX-3822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023386#comment-16023386
]
Samarth Jain edited comment on PHOENIX-3822 at 5/24/17 6:31 PM:
----------------------------------------------------------------
Updated patch.
Changed the interface to reflect that the two methods return null only when the
estimate cannot be provided (for example when stats information is not
available for queries whose scans are executed in parallel).
{code}
/**
* @return estimated number of rows that will be scanned when this
statement plan is been executed.
* Returns null if the estimate cannot be provided.
* @throws SQLException
*/
public Long getEstimatedRowsToScan() throws SQLException;
/**
* @return estimated number of bytes that will be scanned when this
statement plan is been executed.
* Returns null if the estimate cannot be provided.
*/
public Long getEstimatedBytesToScan() throws SQLException;
{code}
For queries that are executed serially, estimates can still be provided. I have
added tests for these scenarios in this patch. Also removed changes in
PhoenixStatement where I was previously returning null for the estimates by
moving the code to BaseMutationPlan. This removed the need of having a base
class with zero estimates for now.
I added those constants in PhoenixRuntime for users so that they can know which
column name to use for getting byte/row info from the explain plan result set.
was (Author: samarthjain):
Updated patch.
Changed the interface to reflect that the two methods return null only when the
estimate cannot be provided (for example when stats information is not
available for queries whose scans are executed in parallel).
{code}
/**
* @return estimated number of rows that will be scanned when this
statement plan is been executed.
* Returns null if the estimate cannot be provided.
* @throws SQLException
*/
public Long getEstimatedRowsToScan() throws SQLException;
/**
* @return estimated number of bytes that will be scanned when this
statement plan is been executed.
* Returns null if the estimate cannot be provided.
*/
public Long getEstimatedBytesToScan() throws SQLException;
{code}
For queries that are executed serially, estimates can still be provided. I have
added tests for these scenarios in this patch. Also removed changes in
PhoenixStatement where I was previously returning null for the estimates by
moving the code to BaseMutationPlan. This removed the need of having a base
class with zero estimates for now.
> Surface byte and row estimates in a machine readable way when doing EXPLAIN
> PLAN
> --------------------------------------------------------------------------------
>
> Key: PHOENIX-3822
> URL: https://issues.apache.org/jira/browse/PHOENIX-3822
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Samarth Jain
> Assignee: Samarth Jain
> Attachments: PHOENIX-3822.patch, PHOENIX-3822_v2.patch,
> PHOENIX-3822_v3.patch, PHOENIX-3822_v4.patch, PHOENIX-3822_v5.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)