[ 
https://issues.apache.org/jira/browse/OOZIE-1468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832136#comment-13832136
 ] 

Robert Kanter commented on OOZIE-1468:
--------------------------------------

[~rohini], [~virag], [~shwethags]: for the added indexes, don't we need to have 
some kind of "upgrade" with the upgrade script?  I just tried using an DB 
created without this patch and then applied the patch and it doesn't look like 
the indexes are automatically added.  I haven't hit any errors, but it could 
just be I haven't done anything that required the new indexes.  

For example, one of the new indexes was the "parent_id" of a workflow, but its 
not listed in the database:
{code:java}
Index: core/src/main/java/org/apache/oozie/WorkflowJobBean.java
===================================================================
--- core/src/main/java/org/apache/oozie/WorkflowJobBean.java    (revision 
1525051)
+++ core/src/main/java/org/apache/oozie/WorkflowJobBean.java    (working copy)
@@ -208,6 +208,7 @@
     private int run = 1;
 
     @Basic
+    @Index
     @Column(name = "parent_id")
     private String parentId;
  
{code}
{noformat}
mysql> show index in WF_JOBS;
+---------+------------+------------------------------+--------------+--------------------+-----------+-------------+----------+--------+------+------------+---------+
| Table   | Non_unique | Key_name                     | Seq_in_index | 
Column_name        | Collation | Cardinality | Sub_part | Packed | Null | 
Index_type | Comment |
+---------+------------+------------------------------+--------------+--------------------+-----------+-------------+----------+--------+------+------------+---------+
| WF_JOBS |          0 | PRIMARY                      |            1 | id       
          | A         |          10 |     NULL | NULL   |      | BTREE      |   
      |
| WF_JOBS |          1 | I_WF_JOBS_END_TIME           |            1 | end_time 
          | A         |          10 |     NULL | NULL   | YES  | BTREE      |   
      |
| WF_JOBS |          1 | I_WF_JOBS_EXTERNAL_ID        |            1 | 
external_id        | A         |           2 |     NULL | NULL   | YES  | BTREE 
     |         |
| WF_JOBS |          1 | I_WF_JOBS_LAST_MODIFIED_TIME |            1 | 
last_modified_time | A         |          10 |     NULL | NULL   | YES  | BTREE 
     |         |
| WF_JOBS |          1 | I_WF_JOBS_STATUS             |            1 | status   
          | A         |          10 |     NULL | NULL   | YES  | BTREE      |   
      |
+---------+------------+------------------------------+--------------+--------------------+-----------+-------------+----------+--------+------+------------+---------+
5 rows in set (0.00 sec)
{noformat}

> Add created time column in WF_ACTIONS and SLA tables
> ----------------------------------------------------
>
>                 Key: OOZIE-1468
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1468
>             Project: Oozie
>          Issue Type: Improvement
>    Affects Versions: 4.0.0
>            Reporter: Shwetha G S
>            Assignee: Rohini Palaniswamy
>             Fix For: trunk
>
>         Attachments: OOZIE-1468-1.patch, OOZIE-1468-2.patch
>
>
> Its useful to have a created_time column in WF_ACTIONS table that is set at 
> insert time and not updated later. This can be used to know time of insert 
> and its required for table partitioning(for db purging).
> Any thoughts?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to