src-db/database/model/tables/AD_TABLE.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 AD_TABLE">
    <table name="AD_TABLE" primaryKey="AD_TABLE_KEY">
      <column name="AD_TABLE_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="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="HELP" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="TABLENAME" primaryKey="false" required="true" type="VARCHAR" size="40" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault><![CDATA[REPLACE(NAME,'_','')]]></onCreateDefault>
      </column>
      <column name="ISVIEW" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ACCESSLEVEL" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISSECURITYENABLED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISDELETEABLE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="ISHIGHVOLUME" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="IMPORTTABLE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISCHANGELOG" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="PO_WINDOW_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISDEFAULTACCT" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="SQL_RECORD_IDENTIFIER" primaryKey="false" required="false" type="VARCHAR" size="4000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DEVELOPMENTSTATUS" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[RE]]></default>
        <onCreateDefault/>
      </column>
      <column name="AD_PACKAGE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="TREETYPE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ACCTDATE_COLUMN_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ACCTCLASSNAME" primaryKey="false" required="false" type="VARCHAR" size="1000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISFULLYAUDITED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
      </column>
      <column name="ISAUDITINSERTS" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault><![CDATA['Y']]></onCreateDefault>
      </column>
      <column name="DATAORIGINTYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[Table]]></default>
        <onCreateDefault><![CDATA['Table']]></onCreateDefault>
      </column>
      <column name="OBSERDS_DATASOURCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISTREE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
      </column>
      <column name="HQLQUERY" primaryKey="false" required="false" type="CLOB" size="4000" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ENTITY_ALIAS" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="OBSERDS_DATASOURCE" name="AD_COLUMN_DATASOURCE">
        <reference local="OBSERDS_DATASOURCE_ID" foreign="OBSERDS_DATASOURCE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_COLUMN" name="AD_COLUMN_TABLE">
        <reference local="ACCTDATE_COLUMN_ID" foreign="AD_COLUMN_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_PACKAGE" name="AD_PACKAGE_TABLE">
        <reference local="AD_PACKAGE_ID" foreign="AD_PACKAGE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_CLIENT" name="AD_TABLE_AD_CLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="AD_TABLE_AD_ORG">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_WINDOW" name="AD_TABLE_AD_WINDOW">
        <reference local="PO_WINDOW_ID" foreign="AD_WINDOW_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_WINDOW" name="AD_WINDOW_TABLE" onDelete="setnull">
        <reference local="AD_WINDOW_ID" foreign="AD_WINDOW_ID"/>
      </foreign-key>
      <index name="AD_TABLE_PACKAGE_IDX" unique="false">
        <index-column name="AD_PACKAGE_ID"/>
      </index>
      <unique name="AD_TABLE_NAME">
        <unique-column name="NAME"/>
      </unique>
      <unique name="AD_TABLE_TREETYPE_UN">
        <unique-column name="TREETYPE"/>
      </unique>
      <check name="AD_TABLE_CLASSNAME_CHK"><![CDATA[UPPER(DATAORIGINTYPE) = 'DATASOURCE' OR UPPER(DATAORIGINTYPE) = 'HQL' OR CLASSNAME IS NOT NULL]]></check>
      <check name="AD_TABLE_DATASOURCE_CHK"><![CDATA[UPPER(DATAORIGINTYPE) <> 'DATASOURCE' OR OBSERDS_DATASOURCE_ID IS NOT NULL]]></check>
      <check name="AD_TABLE_HQL_CHK"><![CDATA[UPPER(DATAORIGINTYPE) <> 'HQL' OR HQLQUERY IS NOT NULL]]></check>
      <check name="AD_TABLE_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISAUDITINS_CHK"><![CDATA[ISAUDITINSERTS IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISDELETEABLE_CHK"><![CDATA[ISDELETEABLE IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISFULLYAUDITED_CHK"><![CDATA[ISFULLYAUDITED IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISFULLYAUDITED_CHK2"><![CDATA[ISFULLYAUDITED = 'N' OR UPPER(TABLENAME) <> 'AD_AUDIT_TRAIL']]></check>
      <check name="AD_TABLE_ISHIGHVOLUME_CHK"><![CDATA[ISHIGHVOLUME IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISSECUR_YENABLED_CHK"><![CDATA[ISSECURITYENABLED IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISTREE_CHK"><![CDATA[ISTREE IN ('Y', 'N')]]></check>
      <check name="AD_TABLE_ISVIEW_CHK"><![CDATA[ISVIEW IN ('Y', 'N')]]></check>
    </table>
  </database>