src-db/database/model/tables/C_BANK.xml
author Armaignac <collazoandy4@gmail.com>
Thu, 05 Dec 2019 16:02:05 -0500
changeset 36865 15ea261d93f9
parent 27289 2f26f004b049
permissions -rw-r--r--
Fixes BUG-42426: Financial account window performance for LASTRECON and
APRM_LASTREC auxiliary inputs

The perfomance for LASTRECON and APRM_LASTREC auxiliary inputs is bad with high
volume of records in fin_reconciliation window because a sequence scan is made
while filtering by created

A new Index for created and fin_financial_account_id columns was created in
fin_reconciliation table
<?xml version="1.0"?>
  <database name="TABLE C_BANK">
    <table name="C_BANK" primaryKey="C_BANK_KEY">
      <column name="C_BANK_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="NAME" primaryKey="false" required="true" type="NVARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ROUTINGNO" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_LOCATION_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="SWIFTCODE" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISOWNBANK" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CODEBANK" primaryKey="false" required="false" type="NVARCHAR" size="4" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CODEBRANCH" primaryKey="false" required="false" type="NVARCHAR" size="4" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DIGITCONTROL" primaryKey="false" required="false" type="NVARCHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="INE_NUMBER" primaryKey="false" required="false" type="NVARCHAR" size="9" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_COUNTRY_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="AD_CLIENT" name="C_BANK_AD_CLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="C_BANK_AD_ORG">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER" name="C_BANK_C_BPARTNER">
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_COUNTRY" name="C_BANK_C_COUNTRY">
        <reference local="C_COUNTRY_ID" foreign="C_COUNTRY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_LOCATION" name="C_BANK_C_LOCATION">
        <reference local="C_LOCATION_ID" foreign="C_LOCATION_ID"/>
      </foreign-key>
      <check name="C_BANK_CODEBANK_CHK"><![CDATA[(CODEBANK IS NULL OR LENGTH(CODEBANK) = 4) AND (CODEBRANCH IS NULL OR LENGTH(CODEBRANCH) = 4) AND (DIGITCONTROL IS NULL OR LENGTH(DIGITCONTROL) = 1)]]></check>
      <check name="C_BANK_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="C_BANK_ISOWNBANK_CHK"><![CDATA[ISOWNBANK IN ('Y', 'N')]]></check>
    </table>
  </database>