[
https://issues.apache.org/jira/browse/HIVE-26144?focusedWorklogId=779087&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-779087
]
ASF GitHub Bot logged work on HIVE-26144:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/22 13:19
Start Date: 07/Jun/22 13:19
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on code in PR #3214:
URL: https://github.com/apache/hive/pull/3214#discussion_r891036728
##########
standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0-alpha-2.derby.sql:
##########
@@ -570,7 +571,8 @@ CREATE TABLE COMPLETED_TXN_COMPONENTS (
CTC_PARTITION varchar(767),
CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
CTC_WRITEID bigint,
- CTC_UPDATE_DELETE char(1) NOT NULL
+ CTC_UPDATE_DELETE char(1) NOT NULL,
+ CTC_ID bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
Review Comment:
@kovjanos try below scenario:
````
create table target (a int, b int) partitioned by (p int, q int) clustered
by (a) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true');
insert into target partition(p,q) values (1,2,1,2), (3,4,1,2), (5,6,1,3),
(7,8,2,2);
create table source (a int, b int, p int, q int);
insert into source values (9,10,1,2), (11,12,1,3), (5,13,1,3);
merge into target t using source s on t.a=s.a
when matched then update set b=s.b
when not matched then insert values(s.a, s.b, s.p, s.q);
````
COMPLETED_TXN_COMPONENTS:
````
CTC_TXNID CTC_DATABASE CTC_TABLE CTC_PARTITION CTC_TIMESTAMP
CTC_WRITEID CTC_UPDATE_DELETE
5 default target p=1/q=2 2022-06-07 05:23:02.748 1 N
5 default target p=1/q=3 2022-06-07 05:23:02.748 1 N
5 default target p=2/q=2 2022-06-07 05:23:02.748 1 N
8 default target p=1/q=3 2022-06-07 05:23:25.464 2 Y
8 default target p=1/q=3 2022-06-07 05:23:25.464 2 Y
8 default target p=1/q=2 2022-06-07 05:23:25.464 2 Y
8 default target p=1/q=3 2022-06-07 05:23:25.464 2 Y
````
Issue Time Tracking
-------------------
Worklog Id: (was: 779087)
Time Spent: 2h 20m (was: 2h 10m)
> Add keys/indexes to support highly concurrent workload
> ------------------------------------------------------
>
> Key: HIVE-26144
> URL: https://issues.apache.org/jira/browse/HIVE-26144
> Project: Hive
> Issue Type: Sub-task
> Components: Database/Schema
> Reporter: Janos Kovacs
> Assignee: Janos Kovacs
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> The following indexes are added to avoid full table-scan in backend rdbms:
> - primary key for COMPLETED_TXN_COMPONENTS
> - primary key for TXN_COMPONENTS
> - index for TXN_WRITE_NOTIFICATION_LOG
--
This message was sent by Atlassian Jira
(v8.20.7#820007)