TAFJ Promoted Columns
TAFJ Promoted Columns
This section explains how to promote columns for TAFJ for performance improvements.
Promoted columns are relational columns where data is generated via a function when it is
inserted/updated. Therefore, these columns will perform better when indexed over an xml
index. NOTE THAT THIS WILL ONLY WORK FOR SINGLE VALUE COLUMNS. To index
multi-value columns see Oracle’s XMLINDEX clause. The advanced USE CASE shows how
to index a multi-value without XMLINDEX, but it requires a code change that probably
wouldn’t work with a normal T24 use case.
This SQL mode command outputs a script to create a promoted column for indexing. Use it
with the SPOOL command.
Here is an example:
tafj@localhost:TB201507>SPOOL
tafj@localhost:TB201507>SPOOL
FBNK_CURRENCY(RANK)@
This is a DB2 example only for recreating the view to use the new column RANK.
CREATE VIEW
TAFJV_FBNK_CURRENCY as
SELECT a.RECID, a.XMLRECORD
"THE_RECORD"
,a.RECID "CURRENCY_CODE"
,RANK "RANK"
,XMLCAST(XMLQUERY('$d/row/c2[position()=1]' passing a.XMLRECORD as "d") as
VARCHAR(4000)) "NUMERIC_CCY_CODE"
,XMLCAST(XMLQUERY('$d/row/c3[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "CCY_NAME"
,XMLQUERY('$d/row/c3' passing a.XMLRECORD as "d") "CCY_NAME_3"
,XMLCAST(XMLQUERY('$d/row/c4[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"NO_OF_DECIMALS"
,XMLCAST(XMLQUERY('$d/row/c5[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"QUOTATION_CODE"
,XMLCAST(XMLQUERY('$d/row/c6[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"QUOTATION_PIPS"
,XMLCAST(XMLQUERY('$d/row/c7[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"DAYS_DELIVERY"