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

YulongZ updated HIVE-23721:
---------------------------
    Description: 
>From Hive3.0,catalog added to hivemeta,many schema of metastore added column 
>“catName”,and index for table added column “catName”。

In MetaStoreDirectSql.ensureDbInit() ,two queries below
“
      initQueries.add(pm.newQuery(MTableColumnStatistics.class, "dbName == 
''"));
      initQueries.add(pm.newQuery(MPartitionColumnStatistics.class, "dbName == 
''"));
”
should use "catName == ''" instead of "dbName == ''",because “catName” is the 
first index column。

When  data of metastore become large,for example, table of 
MPartitionColumnStatistics have millions of lines。The 
“newQuery(MPartitionColumnStatistics.class, "dbName == ''")” for metastore 
executed very slowly,and the query “show tables“ for hiveserver2 executed very 
slowly too。

  was:From Hive3.0,catalog added to hivemeta,many schema of metastore added 
column “catName”,and index for table added column “catName”。For Hive2.0,


> MetaStoreDirectSql.ensureDbInit() need to optimize QuerySQL
> -----------------------------------------------------------
>
>                 Key: HIVE-23721
>                 URL: https://issues.apache.org/jira/browse/HIVE-23721
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 3.1.2
>            Reporter: YulongZ
>            Priority: Minor
>
> From Hive3.0,catalog added to hivemeta,many schema of metastore added column 
> “catName”,and index for table added column “catName”。
> In MetaStoreDirectSql.ensureDbInit() ,two queries below
> “
>       initQueries.add(pm.newQuery(MTableColumnStatistics.class, "dbName == 
> ''"));
>       initQueries.add(pm.newQuery(MPartitionColumnStatistics.class, "dbName 
> == ''"));
> ”
> should use "catName == ''" instead of "dbName == ''",because “catName” is the 
> first index column。
> When  data of metastore become large,for example, table of 
> MPartitionColumnStatistics have millions of lines。The 
> “newQuery(MPartitionColumnStatistics.class, "dbName == ''")” for metastore 
> executed very slowly,and the query “show tables“ for hiveserver2 executed 
> very slowly too。



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

Reply via email to