You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Gang Tim Liu (JIRA)" <ji...@apache.org> on 2013/03/26 23:33:15 UTC

[jira] [Updated] (HIVE-4235) CREATE TABLE IF NOT EXISTS uses inefficient way to check if table exists

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

Gang Tim Liu updated HIVE-4235:
-------------------------------

    Description: 
CREATE TABLE IF NOT EXISTS uses inefficient way to check if table exists.

It uses Hive.java's getTablesByPattern(...) to check if table exists. It involves regular expression and eventually database join. Very efficient. It can cause database lock time increase and hurt db performance if a lot of such commands hit database.

The suggested approach is to use getTable(...) since we know tablename already

  was:
CREATE TABLE IF NOT EXISTS uses inefficient way to check if table exists.

It uses Hive.java's getTablesByPattern(...) to check if table exists. It involves regular expression and eventually database join. Very efficient. May cause database lock time increases and hurt db performance if a lot of such commands hit database.

The suggested approach is to use getTable(...) since we know tablename already

    
> CREATE TABLE IF NOT EXISTS uses inefficient way to check if table exists
> ------------------------------------------------------------------------
>
>                 Key: HIVE-4235
>                 URL: https://issues.apache.org/jira/browse/HIVE-4235
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC, Query Processor, SQL
>            Reporter: Gang Tim Liu
>            Assignee: Gang Tim Liu
>
> CREATE TABLE IF NOT EXISTS uses inefficient way to check if table exists.
> It uses Hive.java's getTablesByPattern(...) to check if table exists. It involves regular expression and eventually database join. Very efficient. It can cause database lock time increase and hurt db performance if a lot of such commands hit database.
> The suggested approach is to use getTable(...) since we know tablename already

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira