[ 
https://issues.apache.org/jira/browse/HIVE-26144?focusedWorklogId=778970&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778970
 ]

ASF GitHub Bot logged work on HIVE-26144:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Jun/22 10:14
            Start Date: 07/Jun/22 10:14
    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),  (3,4,1,2), (11,12,1,3), (5,13,1,3), 
(7,8,2,2), (14,15,1,1);
   
   merge into target t using source s on t.a=s.b 
           when matched and t.a=5 then update set b=s.b                         
              //updates p=1/q=3
           when matched and t.a in (3,7) then delete                            
                      //deletes from p=1/q=2, p=2/q=2
           when not matched and t.a >= 8 then insert values(s.a, s.b, s.p, 
s.q);   //insert p=1/q=2, p=1/q=3 and new part 1/1
   ````
   COMPLETED_TXN_COMPONENTS:
   ````
   CTC_TXNID   CTC_DATABASE   CTC_TABLE   CTC_PARTITION   CTC_TIMESTAMP   
CTC_WRITEID   CTC_UPDATE_DELETE   
   5   default   target   p=2/q=2   2022-06-07 03:07:28.512   1   N   
   5   default   target   p=1/q=2   2022-06-07 03:07:28.512   1   N   
   5   default   target   p=1/q=3   2022-06-07 03:07:28.512   1   N 
   ````





Issue Time Tracking
-------------------

    Worklog Id:     (was: 778970)
    Time Spent: 1h 20m  (was: 1h 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: 1h 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)

Reply via email to