Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043264Openbravo ERPA. Platformpublic2020-02-19 13:402020-02-26 10:49
ALopetegui 
AtulOpenbravo 
normalminoralways
closedfixed 
5
 
3.0PR20Q2 
dmiguelez
Core
No
0043264: Duplicate Indexes in some core table definitions
There are some core tables which have duplicate index because the column indexed, is also indexed in other combined columns on first position. The first element in a combined column, have the same effect as individual index.


This is the list of duplicate index detected:
    ./database/model/tables/C_ORDER.xml
    "c_order_docno" btree (documentno)
    "c_order_documentno_id" btree (documentno, c_order_id)

    ./database/model/tables/M_INOUT.xml
    "m_inout_bp_movementdate" btree (c_bpartner_id, movementdate)
    "m_inout_bpartner" btree (c_bpartner_id)

    ./database/model/tables/M_COSTING.xml
    "m_costing_m_product_id" btree (m_product_id)
    "m_costing_product_date" btree (m_product_id, datefrom, dateto)

    ./database/model/tables/C_PERIODCONTROL.xml
    "c_periodcontrol_docbase" btree (c_period_id, docbasetype, ad_org_id)
    "c_periodcontrol_period" btree (c_period_id)
    "c_periodcontrol_periodorg" btree (c_period_id, ad_org_id)

    ./database/model/tables/MRP_RUN_PURCHASELINE.xml
    "mrp_run_purchline_purchase_id" btree (mrp_run_purchase_id)
    "mrp_run_purhcline_purch_prod" btree (mrp_run_purchase_id, m_product_id)

    ./database/model/tables/MRP_RUN_PRODUCTIONLINE.xml
    "mrp_productionline_id_prod_id" btree (mrp_run_production_id, m_product_id)
    "mrp_run_prodline_production_id" btree (mrp_run_production_id)

    ./database/model/tables/M_OFFER_BPARTNER.xm
    "m_offer_bpartner_cbpartner_id" btree (m_offer_id, c_bpartner_id, m_offer_bpartner_id)
    "m_offerbp_offer_idx" btree (m_offer_id)
Delete individual indexes, because the combined index having the column in the first position, produces the same index.

Attached diff solution.
No tags attached.
diff duplicateIndexes.diff (4,725) 2020-02-19 13:40
https://issues.openbravo.com/file_download.php?file_id=14064&type=bug
Issue History
2020-02-19 13:40ALopeteguiNew Issue
2020-02-19 13:40ALopeteguiAssigned To => platform
2020-02-19 13:40ALopeteguiFile Added: duplicateIndexes.diff
2020-02-19 13:40ALopeteguiModules => Core
2020-02-19 13:40ALopeteguiTriggers an Emergency Pack => No
2020-02-19 13:45ALopeteguiSummaryDuplicate Indexes in some core tables definition => Duplicate Indexes in some core table definitions
2020-02-20 14:24AtulOpenbravoStatusnew => scheduled
2020-02-20 14:24AtulOpenbravoAssigned Toplatform => AtulOpenbravo
2020-02-26 10:46hgbotCheckin
2020-02-26 10:46hgbotNote Added: 0118111
2020-02-26 10:46hgbotStatusscheduled => resolved
2020-02-26 10:46hgbotResolutionopen => fixed
2020-02-26 10:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b130c2f44f08e45ad23da49db0904f643e5a6282 [^]
2020-02-26 10:49dmiguelezReview Assigned To => dmiguelez
2020-02-26 10:49dmiguelezNote Added: 0118114
2020-02-26 10:49dmiguelezStatusresolved => closed
2020-02-26 10:49dmiguelezFixed in Version => 3.0PR20Q2

Notes
(0118111)
hgbot   
2020-02-26 10:46   
Repository: erp/devel/pi
Changeset: b130c2f44f08e45ad23da49db0904f643e5a6282
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Feb 20 23:28:00 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/b130c2f44f08e45ad23da49db0904f643e5a6282 [^]

Fixes BUG-0043264:Duplicate Indexes in some core table definitions

**Remove duplicate indexes for
**Documentno in C_ORDER
**C_Period_ID in C_PERIODCONTROL
**MRP_RUN_PRODUCTION_ID in MRP_RUN_PRODUCTIONLINE
**MRP_RUN_PURCHASE_ID in MRP_RUN_PURCHASELINE
**M_PRODUCT_ID in M_COSTING
**C_BPARTNER_ID in M_INOUT
**M_OFFER_ID in M_OFFER_BPARTNER

---
M src-db/database/model/tables/C_ORDER.xml
M src-db/database/model/tables/C_PERIODCONTROL.xml
M src-db/database/model/tables/MRP_RUN_PRODUCTIONLINE.xml
M src-db/database/model/tables/MRP_RUN_PURCHASELINE.xml
M src-db/database/model/tables/M_COSTING.xml
M src-db/database/model/tables/M_INOUT.xml
M src-db/database/model/tables/M_OFFER_BPARTNER.xml
---
(0118114)
dmiguelez   
2020-02-26 10:49   
Code Review + Testing Ok