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

Rui Wang commented on CALCITE-3665:
-----------------------------------

Ah I think I got what you meant:

if one side of join is unique, then estimate rows will be rowCount(another join 
side).

> Better estimate join row count when one of the sides is known to be unique
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-3665
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3665
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.21.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> For instance:
> 1) select from emp e left join  dept d on (e.X = d.id)
> This query can't multiply rows, so its row count estimation is 
> rowCount(join.left)
> 2) select from dept d right join emp e on (d.id = e.X)
> This query can't multiply rows, so its row count estimation is 
> rowCount(join.right)
> 3) select from emp e join  dept d on (e.id = d.id)
> The rows can't be multiplied here as well
> Currently, Calcite estimates the number of rows as left*right which is an 
> overestimation in many cases :(



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to