Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040129Openbravo ERP07. Sales managementpublic2019-02-04 13:052019-02-13 09:09
vmromanos 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q13.0PR19Q1 
Sandrahuguet
Core
No
0040129: Set two new columns in C_Invoice as nullable and do not set a default value
In Create Lines From Refactor introduced in 18Q4, two new columns were added to C_Invoice table: CREATEFROMORDERS and CREATEFROMINOUTS.

They were set as mandatory and default value 'N'.

In versions before PG 11 this configuration adds an important overhead when creating the columns. So to avoid a performance issue in the update process, it would be better to set both columns as nullable and without a default value.

Basically is to revert the changeset: https://code.openbravo.com/erp/devel/pi/rev/7d6426933ab5 [^]
In a HV table, like c_order, run:
ALTER TABLE c_order add COLUMN test character varying(1) default 'N';
Check it's very slow.

Now run:
ALTER TABLE c_order add COLUMN test2 character varying(1);
It's almost immediate.

No tags attached.
blocks defect 0040119 closed AtulOpenbravo Set two new columns in C_Invoice as nullable and do not set a default value 
Issue History
2019-02-04 20:10AtulOpenbravoTypedefect => backport
2019-02-04 20:10AtulOpenbravoTarget Version => 3.0PR19Q1
2019-02-13 08:44hgbotCheckin
2019-02-13 08:44hgbotNote Added: 0109787
2019-02-13 08:44hgbotStatusscheduled => resolved
2019-02-13 08:44hgbotResolutionopen => fixed
2019-02-13 08:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR19Q1/rev/a7776fdd82a7ed3982632283e3bfd17292688d7c [^]
2019-02-13 09:09SandrahuguetReview Assigned To => Sandrahuguet
2019-02-13 09:09SandrahuguetNote Added: 0109791
2019-02-13 09:09SandrahuguetStatusresolved => closed
2019-02-13 09:09SandrahuguetFixed in Version => 3.0PR19Q1

Notes
(0109787)
hgbot   
2019-02-13 08:44   
Repository: erp/backports/3.0PR19Q1
Changeset: a7776fdd82a7ed3982632283e3bfd17292688d7c
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 13 10:00:08 2019 +0530
URL: http://code.openbravo.com/erp/backports/3.0PR19Q1/rev/a7776fdd82a7ed3982632283e3bfd17292688d7c [^]

Fixes Issue 40129:Set two new columns in C_Invoice as nullable and do not
set a default value

** Remove NOT NULL constraint for columns CREATEFROMORDERS, CREATEFROMINOUTS
** Avoid setting DEFAULT value N for above columns.
** Remove check constraint either Y or N for above columns.

---
M src-db/database/model/tables/C_INVOICE.xml
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0109791)
Sandrahuguet   
2019-02-13 09:09   
Code review + testing ok