You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/05/30 14:09:00 UTC

[jira] [Work logged] (HIVE-22238) PK/FK selectivity estimation underscales estimations

     [ https://issues.apache.org/jira/browse/HIVE-22238?focusedWorklogId=439078&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439078 ]

ASF GitHub Bot logged work on HIVE-22238:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/May/20 14:08
            Start Date: 30/May/20 14:08
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk closed pull request #831:
URL: https://github.com/apache/hive/pull/831


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 439078)
    Time Spent: 50m  (was: 40m)

> PK/FK selectivity estimation underscales estimations
> ----------------------------------------------------
>
>                 Key: HIVE-22238
>                 URL: https://issues.apache.org/jira/browse/HIVE-22238
>             Project: Hive
>          Issue Type: Bug
>          Components: Statistics
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>         Attachments: HIVE-22238.01.patch, HIVE-22238.02.patch, HIVE-22238.03.patch, HIVE-22238.04.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.06.patch, HIVE-22238.06.patch, HIVE-22238.07.patch, HIVE-22238.09.patch, HIVE-22238.10.patch, HIVE-22238.10.patch, HIVE-22238.10.patch, HIVE-22238.10.patch
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> at [this point|https://github.com/apache/hive/blob/5098d155a1e6a164253f5fa98755273bc34085df/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java#L2182] the parent operators rownum is scaled according to pkfkselectivity
> however [pkfkselectivity is computed|https://github.com/apache/hive/blob/5098d155a1e6a164253f5fa98755273bc34085df/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java#L2157] on a whole subtree.
> Scaling it by that amount will count in estimation already used when parentstats was calculated...so depending on the number of upstream joins - this may lead to severe underestimations
> what happened was:
> * optimization was able to push the filter to the other side of the join
> * as a result the incoming data was already filtered
> * scaling down by the PK selectiviy - was actually already there...but a new "scaling" happened



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