polishing up idea of default value including auto increment of a column in table
--------------------------------------------------------------------------------

         Key: DERBY-252
         URL: http://issues.apache.org/jira/browse/DERBY-252
     Project: Derby
        Type: Task
  Components: Documentation  
    Reporter: Tomohito Nakayama
    Priority: Minor


 This is not bug. However, there exists some complexity in the part of default 
value and autoincrement value in current implementation of derby.
 Take aside whether any modification to be done or not for this issue, 
polishing up the idea of default including autoincrement would be help thinking 
about default and autoincrement.


Next is my idea for default...

 "default value of the column" is value which registered to the column when a 
record was inserted without any value.

 "default value of the column" can be one of the next.
  def_1: default does not exist
  def_2: constant value
  def_3: generated by a rule
  def_3-1: autoincrement value
  def_3-2: value generated by more complex rule than autoincrement (This does 
not exists in derby)

 There exists question wheter def_3 is truly default or not.


 In the current implementation of derby, object interfaced as 
"org.apache.derby.catalog.DefaultInfo" was externalized to "COLUMNDEFAULT" of 
"SYS_COLUMNS" in the case of def_2, and the object have information of what 
constant value is used as default value.
 On the other hand, information about autoincrement value was stored to 
"IDENTITYCOLUMNVALUE", "IDENTITYCOLUMNSTART", "IDENTITYCOLUMNINC" of 
"SYS_COLUMNS".

 There exists question in the case of def_3, why information about 
autoincrement value does not exist in DefaultInfo.
 One answer for this question is that storing information in 
"IDENTITYCOLUMNVALUE" to DefaultInfo would cause performance trouble, because 
this will cause re-storing all information of DefaultInfo always when record 
was inserted and next autoincrement value was prepared. 
 But this answer does not explan about information of "IDENTITYCOLUMNSTART", 
"IDENTITYCOLUMNINC".


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to