diff --git metastore/scripts/upgrade/derby/040-HIVE-16399.derby.sql metastore/scripts/upgrade/derby/040-HIVE-16399.derby.sql new file mode 100644 index 0000000..f6cc31f --- /dev/null +++ metastore/scripts/upgrade/derby/040-HIVE-16399.derby.sql @@ -0,0 +1 @@ +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); diff --git metastore/scripts/upgrade/derby/hive-txn-schema-2.3.0.derby.sql metastore/scripts/upgrade/derby/hive-txn-schema-2.3.0.derby.sql index 3a049aa..52713df 100644 --- metastore/scripts/upgrade/derby/hive-txn-schema-2.3.0.derby.sql +++ metastore/scripts/upgrade/derby/hive-txn-schema-2.3.0.derby.sql @@ -36,6 +36,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/derby/hive-txn-schema-3.0.0.derby.sql metastore/scripts/upgrade/derby/hive-txn-schema-3.0.0.derby.sql index 3a049aa..52713df 100644 --- metastore/scripts/upgrade/derby/hive-txn-schema-3.0.0.derby.sql +++ metastore/scripts/upgrade/derby/hive-txn-schema-3.0.0.derby.sql @@ -36,6 +36,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/derby/upgrade-2.2.0-to-2.3.0.derby.sql metastore/scripts/upgrade/derby/upgrade-2.2.0-to-2.3.0.derby.sql index b638591..81b9973 100644 --- metastore/scripts/upgrade/derby/upgrade-2.2.0-to-2.3.0.derby.sql +++ metastore/scripts/upgrade/derby/upgrade-2.2.0-to-2.3.0.derby.sql @@ -1,3 +1,4 @@ -- Upgrade MetaStore schema from 2.2.0 to 2.3.0 +RUN '040-HIVE-16399.derby.sql'; UPDATE "APP".VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1; diff --git metastore/scripts/upgrade/mssql/025-HIVE-16399.mssql.sql metastore/scripts/upgrade/mssql/025-HIVE-16399.mssql.sql new file mode 100644 index 0000000..f6cc31f --- /dev/null +++ metastore/scripts/upgrade/mssql/025-HIVE-16399.mssql.sql @@ -0,0 +1 @@ +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); diff --git metastore/scripts/upgrade/mssql/hive-schema-2.3.0.mssql.sql metastore/scripts/upgrade/mssql/hive-schema-2.3.0.mssql.sql index a84589f..8a80a50 100644 --- metastore/scripts/upgrade/mssql/hive-schema-2.3.0.mssql.sql +++ metastore/scripts/upgrade/mssql/hive-schema-2.3.0.mssql.sql @@ -974,6 +974,8 @@ CREATE TABLE TXN_COMPONENTS( ALTER TABLE TXN_COMPONENTS WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE AUX_TABLE ( MT_KEY1 nvarchar(128) NOT NULL, MT_KEY2 bigint NOT NULL, diff --git metastore/scripts/upgrade/mssql/hive-schema-3.0.0.mssql.sql metastore/scripts/upgrade/mssql/hive-schema-3.0.0.mssql.sql index d1b2588..98682a8 100644 --- metastore/scripts/upgrade/mssql/hive-schema-3.0.0.mssql.sql +++ metastore/scripts/upgrade/mssql/hive-schema-3.0.0.mssql.sql @@ -974,6 +974,8 @@ CREATE TABLE TXN_COMPONENTS( ALTER TABLE TXN_COMPONENTS WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE AUX_TABLE ( MT_KEY1 nvarchar(128) NOT NULL, MT_KEY2 bigint NOT NULL, diff --git metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql index ae238bd..04dafba 100644 --- metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql +++ metastore/scripts/upgrade/mssql/upgrade-2.2.0-to-2.3.0.mssql.sql @@ -1,4 +1,6 @@ SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE; +:r 025-HIVE-16399.mssql.sql + UPDATE VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0' AS MESSAGE; diff --git metastore/scripts/upgrade/mysql/040-HIVE-16399.mysql.sql metastore/scripts/upgrade/mysql/040-HIVE-16399.mysql.sql new file mode 100644 index 0000000..f6cc31f --- /dev/null +++ metastore/scripts/upgrade/mysql/040-HIVE-16399.mysql.sql @@ -0,0 +1 @@ +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); diff --git metastore/scripts/upgrade/mysql/hive-txn-schema-2.3.0.mysql.sql metastore/scripts/upgrade/mysql/hive-txn-schema-2.3.0.mysql.sql index ac39a32..1df32c4 100644 --- metastore/scripts/upgrade/mysql/hive-txn-schema-2.3.0.mysql.sql +++ metastore/scripts/upgrade/mysql/hive-txn-schema-2.3.0.mysql.sql @@ -38,6 +38,8 @@ CREATE TABLE TXN_COMPONENTS ( FOREIGN KEY (TC_TXNID) REFERENCES TXNS (TXN_ID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint NOT NULL, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/mysql/hive-txn-schema-3.0.0.mysql.sql metastore/scripts/upgrade/mysql/hive-txn-schema-3.0.0.mysql.sql index ac39a32..1df32c4 100644 --- metastore/scripts/upgrade/mysql/hive-txn-schema-3.0.0.mysql.sql +++ metastore/scripts/upgrade/mysql/hive-txn-schema-3.0.0.mysql.sql @@ -38,6 +38,8 @@ CREATE TABLE TXN_COMPONENTS ( FOREIGN KEY (TC_TXNID) REFERENCES TXNS (TXN_ID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint NOT NULL, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/mysql/upgrade-2.2.0-to-2.3.0.mysql.sql metastore/scripts/upgrade/mysql/upgrade-2.2.0-to-2.3.0.mysql.sql index 210423e..9da8757 100644 --- metastore/scripts/upgrade/mysql/upgrade-2.2.0-to-2.3.0.mysql.sql +++ metastore/scripts/upgrade/mysql/upgrade-2.2.0-to-2.3.0.mysql.sql @@ -1,5 +1,7 @@ SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0' AS ' '; +SOURCE 040-HIVE-16399.mysql.sql; + UPDATE VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0' AS ' '; diff --git metastore/scripts/upgrade/oracle/040-HIVE-16399.oracle.sql metastore/scripts/upgrade/oracle/040-HIVE-16399.oracle.sql new file mode 100644 index 0000000..f6cc31f --- /dev/null +++ metastore/scripts/upgrade/oracle/040-HIVE-16399.oracle.sql @@ -0,0 +1 @@ +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); diff --git metastore/scripts/upgrade/oracle/hive-txn-schema-2.3.0.oracle.sql metastore/scripts/upgrade/oracle/hive-txn-schema-2.3.0.oracle.sql index 80adfc2..12c24a5 100644 --- metastore/scripts/upgrade/oracle/hive-txn-schema-2.3.0.oracle.sql +++ metastore/scripts/upgrade/oracle/hive-txn-schema-2.3.0.oracle.sql @@ -37,6 +37,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ) ROWDEPENDENCIES; +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID NUMBER(19), CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/oracle/hive-txn-schema-3.0.0.oracle.sql metastore/scripts/upgrade/oracle/hive-txn-schema-3.0.0.oracle.sql index 80adfc2..12c24a5 100644 --- metastore/scripts/upgrade/oracle/hive-txn-schema-3.0.0.oracle.sql +++ metastore/scripts/upgrade/oracle/hive-txn-schema-3.0.0.oracle.sql @@ -37,6 +37,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ) ROWDEPENDENCIES; +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID NUMBER(19), CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/oracle/upgrade-2.2.0-to-2.3.0.oracle.sql metastore/scripts/upgrade/oracle/upgrade-2.2.0-to-2.3.0.oracle.sql index a936d42..64a3313 100644 --- metastore/scripts/upgrade/oracle/upgrade-2.2.0-to-2.3.0.oracle.sql +++ metastore/scripts/upgrade/oracle/upgrade-2.2.0-to-2.3.0.oracle.sql @@ -1,4 +1,6 @@ SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0' AS Status from dual; +@040-HIVE-16399.oracle.sql; + UPDATE VERSION SET SCHEMA_VERSION='2.3.0', VERSION_COMMENT='Hive release version 2.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0' AS Status from dual; diff --git metastore/scripts/upgrade/postgres/039-HIVE-16399.postgres.sql metastore/scripts/upgrade/postgres/039-HIVE-16399.postgres.sql new file mode 100644 index 0000000..18157bf --- /dev/null +++ metastore/scripts/upgrade/postgres/039-HIVE-16399.postgres.sql @@ -0,0 +1 @@ +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS USING hash (TC_TXNID); diff --git metastore/scripts/upgrade/postgres/hive-txn-schema-2.3.0.postgres.sql metastore/scripts/upgrade/postgres/hive-txn-schema-2.3.0.postgres.sql index 8471c32..1fa99af 100644 --- metastore/scripts/upgrade/postgres/hive-txn-schema-2.3.0.postgres.sql +++ metastore/scripts/upgrade/postgres/hive-txn-schema-2.3.0.postgres.sql @@ -37,6 +37,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS USING hash (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/postgres/hive-txn-schema-3.0.0.postgres.sql metastore/scripts/upgrade/postgres/hive-txn-schema-3.0.0.postgres.sql index 8471c32..1fa99af 100644 --- metastore/scripts/upgrade/postgres/hive-txn-schema-3.0.0.postgres.sql +++ metastore/scripts/upgrade/postgres/hive-txn-schema-3.0.0.postgres.sql @@ -37,6 +37,8 @@ CREATE TABLE TXN_COMPONENTS ( TC_OPERATION_TYPE char(1) NOT NULL ); +CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS USING hash (TC_TXNID); + CREATE TABLE COMPLETED_TXN_COMPONENTS ( CTC_TXNID bigint, CTC_DATABASE varchar(128) NOT NULL, diff --git metastore/scripts/upgrade/postgres/upgrade-2.2.0-to-2.3.0.postgres.sql metastore/scripts/upgrade/postgres/upgrade-2.2.0-to-2.3.0.postgres.sql index b27ce6b..77358df 100644 --- metastore/scripts/upgrade/postgres/upgrade-2.2.0-to-2.3.0.postgres.sql +++ metastore/scripts/upgrade/postgres/upgrade-2.2.0-to-2.3.0.postgres.sql @@ -1,5 +1,7 @@ SELECT 'Upgrading MetaStore schema from 2.2.0 to 2.3.0'; +\i 039-HIVE-16399.postgres.sql; + UPDATE "VERSION" SET "SCHEMA_VERSION"='2.3.0', "VERSION_COMMENT"='Hive release version 2.3.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 2.2.0 to 2.3.0';