[ 
https://issues.apache.org/jira/browse/HIVE-26559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

shuaiqi.guo updated HIVE-26559:
-------------------------------
    Description: 
In some cases, queries may get executed with where condition mentioning to 
"1=0" to get schema. E.g
{noformat}
SELECT
  *
FROM
  table_with_millions_of_partitions
WHERE
  1=0
{noformat}
In actual production, it likes:
{noformat}
SELECT
  *
FROM
  table_with_millions_of_partitions
WHERE
  partition_col1 = value1
  and partition_col2 = value2
  and if(some conditions, true, false)
{noformat}
 

When the cbo optimizer optimizes the execution plan of this query, the cbo 
optimizer will get all the partitions of table_with_millions_of_partitions. 
This seems useless and causes hiveserver to fail when the number of partitions 
is very high.

 

Use this patch to skip unnecessary get all partition operation when pruneNode 
is always false.

  was:
In some cases, queries may get executed with where condition mentioning to 
"1=0" to get schema. E.g
{noformat}
SELECT
  *
FROM
  table_with_millions_of_partitions
WHERE
  1=0
{noformat}
When the cbo optimizer optimizes the execution plan of this query, the cbo 
optimizer will get all the partitions of table_with_millions_of_partitions. 
This seems useless and causes hiveserver to fail when the number of partitions 
is very high.

 

Use this patch to skip unnecessary get all partition operation when pruneNode 
is always false.


> Skip unnecessary get all partition operations when where condition with 1=0 
> in CBO.
> -----------------------------------------------------------------------------------
>
>                 Key: HIVE-26559
>                 URL: https://issues.apache.org/jira/browse/HIVE-26559
>             Project: Hive
>          Issue Type: Improvement
>          Components: CBO
>    Affects Versions: All Versions
>            Reporter: shuaiqi.guo
>            Assignee: shuaiqi.guo
>            Priority: Major
>             Fix For: All Versions
>
>         Attachments: HIVE-26559.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In some cases, queries may get executed with where condition mentioning to 
> "1=0" to get schema. E.g
> {noformat}
> SELECT
>   *
> FROM
>   table_with_millions_of_partitions
> WHERE
>   1=0
> {noformat}
> In actual production, it likes:
> {noformat}
> SELECT
>   *
> FROM
>   table_with_millions_of_partitions
> WHERE
>   partition_col1 = value1
>   and partition_col2 = value2
>   and if(some conditions, true, false)
> {noformat}
>  
> When the cbo optimizer optimizes the execution plan of this query, the cbo 
> optimizer will get all the partitions of table_with_millions_of_partitions. 
> This seems useless and causes hiveserver to fail when the number of 
> partitions is very high.
>  
> Use this patch to skip unnecessary get all partition operation when pruneNode 
> is always false.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to