0% found this document useful (0 votes)
1K views25 pages

How To Implement 'Promoted Columns' On ORACLE Database For TAFJ

TEST
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views25 pages

How To Implement 'Promoted Columns' On ORACLE Database For TAFJ

TEST
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Temenos Support Forum (/SitePages/tsf.aspx)  Portal Help eridanitcsp

Customer Support
Portal
(/SitePages/Home.aspx)

 MENU Entire Site Enter your keywords here 

w%20to%20implement%20%27Promoted%20Columns%27%20on%20ORACLE%20database%20for%20TAFJ%20%20?
s%27%20on%20ORACLE%20database%20for%20TAFJ%20%20?%20%20%20-
AFJ.aspx)

 (/SitePages/Home.aspx) How to implement 'Promoted


 (/SitePages/T24Intelligence.aspx)

Columns' on ORACLE  database for
 (/TCSPProfileCenter/infodefault.aspx)
TAFJ  ?
 (/Support/DashBoard.aspx)

Introduction
 
This document describes the implementation of normal
indexing and promoted columns on ORACLE database for
TAFJ. This has been done to improve the performance of
‘expensive’ queries such that response times are reduced.

The principle is that certain elds used in the expensive


select statement whose response time is higher can be
promoted, i.e. duplicated into a separate relational column,
so that it can be retrieved more quickly. In addition, an
index can be created on the individual column to further
increase performance.

The TAFJ driver currently uses views to get information


from the XML column of T24 database. The View de nition
will be altered to use the new column and TAFJ driver will
subsequently use this relational column for data access.
Make sure to create altered promoted column name
equivalent to the actual eld name in order to update the Was this page
view.  

NOTE: This feature by de nition is only valid for XML type


Yes
columns. 

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 1/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Single Value Field


Indexing

Single value eld indexing in


oracle 11g

Step 1: Note down oracle view name

Get into DBTools-> JQL prompt and execute the command


“GETDBNAME FBNK.AA.ARRANGEMENT” in order to make
note on oracle view name of the table

 (/SitePages/Home.aspx)
  ----------------------------------------------------------------------
 (/SitePages/T24Intelligence.aspx)
 DBTools         JQL                                                P1:

 ----------------------------------------------------------------------
 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx)  BASICBasic le name:|FBNK.AA.ARRANGEMENT

 Oracle le name:    |FBNK_AA_ARRANGEMENT

 Oracle dict name:    |D_F_AA_ARRANGEMENT

 Oracle view name:    |TAFJV_FBNK_AA_ARRANGEMENT

Step 2:  DDL extraction

Execute the below command in sqlplus in order to get the data


de nition language for the problematic eld. "R13TAFJ" denotes
the currently logged in database user name.

SQL> SET LONG 50000;

SQL> select
dbms_metadata.get_ddl('VIEW','TAFJV_FBNK_AA_ARRANGEMENT','R
13TAFJ') from dual;

,extractValue(a.XMLRECORD,'/row/c10[position()=1]')
"PRODUCT_LINE"

Was this page


Step 3:  Index creation

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 2/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Please nd the below sample command in order to


create index for single value eld using the de nition
extracted in step- 2.

SQL> CREATE INDEX ix_FBNK_AA_ARRANGEMENT_c10 ON


FBNK_AA_ARRANGEMENT a
(extractValue(a.XMLRECORD,'/row/c10[position()=1]'));

Index created.

SQL>

Execute the below command and check whether the


index has been created successfully.

SQL> SELECT INDEX_NAME FROM USER_INDEXES WHERE


TABLE_NAME='FBNK_AA_ARRANGEMENT';

 (/SitePages/Home.aspx) INDEX_NAME
 (/SitePages/T24Intelligence.aspx)
------------------------------

SYS_IL0000214841C00003$$
 (/TCSPProfileCenter/infodefault.aspx)
SYS_C0075206
 (/Support/DashBoard.aspx)
IX_FBNK_AA_ARRANGEMENT_C10

SQL>   

Step 4: Explain plan execution

Check with explain plan whether the select makes use of


Index with below commands.

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan100' FOR


SELECT RECID FROM "TAFJV_FBNK_AA_ARRANGEMENT"
WHERE "PRODUCT_LINE" = 'ACCOUNTS';

Explained.

SQL>

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL,
'ex_plan100','BASIC'));

PLAN_TABLE_OUTPUT
Was this page
--------------------------------------------------------------------------------

Plan hash value: 1243810747


Yes
------------------------------------------------------------------
https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 3/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

| Id  | Operation                   | Name                       |

------------------------------------------------------------------

|   0 | SELECT STATEMENT            |                            |

|    1 |  TABLE ACCESS BY INDEX ROWID|


FBNK_AA_ARRANGEMENT        |

|    2 |    INDEX RANGE SCAN                  |


IX_FBNK_AA_ARRANGEMENT_C10 |

------------------------------------------------------------------

9 rows selected.

SQL>

Step 5: Index utilization check


 
 (/SitePages/Home.aspx)
Select command output extracted for "PRODUCT.LINE"
 (/SitePages/T24Intelligence.aspx)
eld before and after indexing along with time taken

Before Index creation:
 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx) SQL> SELECT RECID FROM
"TAFJV_FBNK_AA_ARRANGEMENT" WHERE
"PRODUCT_LINE" = 'ACCOUNTS';

162 rows selected.

Elapsed: 00:00:00.33

SQL>

After index creation:

SQL> SELECT RECID FROM


"TAFJV_FBNK_AA_ARRANGEMENT" WHERE
"PRODUCT_LINE" = 'ACCOUNTS';

162 rows selected.

Elapsed: 00:00:00.25

SQL>

Was this page


Single value Field using
TO_NUMBER function Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 4/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Step 1: Note down oracle view name

Get into DBTools-> JQL prompt and execute the command


“GETDBNAME FBNK.ACCOUNT” in order to make note on
oracle view name of the table.

---------------------------------------------

DBTools         JQL

---------------------------------------------

BASICBasic le name:|FBNK.ACCOUNT

Oracle le name:    |FBNK_ACCOUNT

Oracle dict name:    |D_F_ACCOUNT


 (/SitePages/Home.aspx)
Oracle view name:    |V_FBNK_ACCOUNT
 (/SitePages/T24Intelligence.aspx)
 Set the TAFJTrace.properties inside "TAFJ_HOME\conf"
directory to DEBUG for below properties in order to
 (/TCSPProfileCenter/infodefault.aspx)
check whether the eld which we are going to index is
 (/Support/DashBoard.aspx)
making use of any functions.

log4j.logger.JQL=DEBUG,      jql

log4j.logger.SQLTRACE=DEBUG, sqltrace

JQL.log:

JQL  - SQL    : SELECT RECID FROM "V_FBNK_ACCOUNT"


WHERE  TO_NUMBER("CATEGORY")  = ? and "CO_CODE" =
? ORDER BY  TO_NUMBER(NVL("CATEGORY",0)) ,
"CURRENCY",  RECID

[DEBUG] 2016-02-25 11:30:29,537 [EX_386059807] JQL  -


COUNT : 378

SQLTRACE.log:

SQLTRACE  - SELECT RECID FROM "V_FBNK_ACCOUNT"


WHERE  TO_NUMBER("CATEGORY")  = ? and "CO_CODE" =
? ORDER BY  TO_NUMBER(NVL("CATEGORY",0)) ,
"CURRENCY",  RECID:VALUES:1001:GB0010001

Step 2:  DDL extraction    Was this page

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 5/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Execute the below command in sqlplus in order to get


the data de nition language for the problematic eld.
"R14TAFJ" denotes the currently logged in database user
name.

SQL> SET LINESIZE 32000;

SQL> SET PAGESIZE 40000;

SQL> SET LONG 50000;

SQL> select
dbms_metadata.get_ddl('VIEW','V_FBNK_ACCOUNT','R14TA
FJ') from dual;

,extractValue(a.XMLRECORD,'/row/c2[position()=1]')
"CATEGORY"

 (/SitePages/Home.aspx) …
 (/SitePages/T24Intelligence.aspx)

Step 3:  Index creation 
 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx) Please nd the below sample command in order to
create index for single value eld which make use of
"TO_NUMBER" function using the de nition extracted in
step-2.

SQL> CREATE INDEX ix_FBNK_ACCOUNT_c2 ON


FBNK_ACCOUNT a
(TO_NUMBER(extractValue(a.XMLRECORD,'/row/c2[position
()=1]')));

Index created.

SQL>

Execute the below command and check whether the


index has been created successfully.

SQL> SELECT INDEX_NAME FROM USER_INDEXES WHERE


TABLE_NAME='FBNK_ACCOUNT';

INDEX_NAME

------------------------------

SYS_IL0000109118C00003$$ Was this page


SYS_C0029401

IX_FBNK_ACCOUNT_C2 Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 6/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

SQL>

Step 4:  Explain plan execution


 
Check with explain plan whether the select makes use of Index
with below commands.

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan100' FOR SELECT


RECID FROM "V_FBNK_ACCOUNT" WHERE
TO_NUMBER("CATEGORY")  = '1001';

Explained.

Elapsed: 00:00:00.06

SQL>

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan100','BASIC'));

PLAN_TABLE_OUTPUT
 (/SitePages/Home.aspx)
--------------------------------------------------------------------------------
 (/SitePages/T24Intelligence.aspx)
Plan hash value: 1137255371

----------------------------------------------------------
 (/TCSPProfileCenter/infodefault.aspx)
| Id  | Operation                   | Name               |
 (/Support/DashBoard.aspx)
----------------------------------------------------------

|   0 | SELECT STATEMENT            |                    |

|   1 |  TABLE ACCESS BY INDEX ROWID| FBNK_ACCOUNT       |

|   2 |   INDEX RANGE SCAN          | IX_FBNK_ACCOUNT_C2 |

----------------------------------------------------------

9 rows selected.

Elapsed: 00:00:00.02

SQL>

Step 5:  Explain plan execution

Select command output extracted for CATEGORY eld before and


after indexing along with time taken

Before Index creation:

SELECT RECID FROM "V_FBNK_ACCOUNT" WHERE 


TO_NUMBER("CATEGORY")  = '1001' Was this page

382 rows selected.

Elapsed: 00:00:00.62 Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 7/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

SQL>

After index creation:

SQL> SELECT RECID FROM "V_FBNK_ACCOUNT" WHERE 


TO_NUMBER("CATEGORY")  = '1001';

382 rows selected.

Elapsed: 00:00:00.48

SQL>

Single value eld indexing in


oracle 12c

XML Type data indexing in oracle database:


 (/SitePages/Home.aspx) Function-Based Indexes are deprecated for XMLType after
Database 11g Release 2 (11.2). Hence please nd the
 (/SitePages/T24Intelligence.aspx)
sample reference for the single value eld indexing with

XMLType index.
 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx)
Step 1: Retrieve the original view DDL

Here we use V_FBNK_DIARY as an example


select dbms_metadata.get_ddl('VIEW', 'V_FBNK_DIARY') from dual;
Find out the view eld de nition, here we use EVENT_TYPE &
EVENT_STATUS as an example eld to be indexed. (Here we use
multiple eld composite indexing)

,extractValue(a.XMLRECORD,'/row/c122[position()=1]')
"EVENT_STATUS"
,extractValue(a.XMLRECORD,'/row/c4[position()=1]') "EVENT_TYPE"

Step 2: Create a Virtual Column on FBNK_DIARY table

Copy the eld de nition logic from the view to create


Virtual column
As extractValue is deprecated in 11g, alternatively you
could use XMLQuery syntax instead, e.g.
-- The columns here are de ned as VARCHR2. Change to
other data type (e.g. NUMBER) if the elds are not
-- string type.
Was this page

SQL> alter table FBNK_DIARY add (


Yes
  2  EVENT_TYPE varchar2(100) GENERATED ALWAYS AS

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 8/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

(XMLCast(XMLQuery('/row/c4[position()=1]' PASSING
XMLRECORD RETURNING CONTENT) AS VARCHAR2(100)))
VIRTUAL,
  3  EVENT_STATUS varchar2(100) GENERATED ALWAYS AS
(XMLCast(XMLQuery('/row/c122[position()=1]' PASSING
XMLRECORD RETURNING CONTENT) AS VARCHAR2(100)))
VIRTUAL
  4  );
Table altered.

SQL> COMMIT;

Commit complete.

Step 3: Create the Virtual Column Index


 (/SitePages/Home.aspx)
 (/SitePages/T24Intelligence.aspx)
If “EVENT_STATUS” is used in null checking conditions in the
 queries (e.g. EVENT_STATUS is NULL), then a special
composite index type needs to be created to deal with the
 (/TCSPProfileCenter/infodefault.aspx)
null checking.
 (/Support/DashBoard.aspx)
-- Trailing “0” is added to handle null value scenarios

Syntax:
CREATE INDEX IX_FBNK_DIARY_EVENT_TYPESTATUS ON
FBNK_DIARY (EVENT_TYPE, EVENT_STATUS, 0) TABLESPACE
T24DATA_TBSPACE;

Example:
SQL> CREATE INDEX IX_FBNK_DIARY_EVENT_TYPESTATUS
ON FBNK_DIARY (EVENT_TYPE, EVENT_STATUS, 0)
TABLESPACE R15;
Index created.

SQL>
 
Step  4:  Replace the view eld with the new virtual
column by rebuilding the STANDARD.SELECTION record

Note: In lower release view will be updated as


,"column_reference" whereas in latest releases the view
will be updated as ,<alias_name>."column_reference"

Was this page


,extract(a.XMLRECORD,'/row/c3') "NARRATIVE_3"

,a."EVENT_TYPE"
Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 9/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

,extractValue(a.XMLRECORD,'/row/c5[posi on()=1]') "DEPOSITORY"

...

...

,extractValue(a.XMLRECORD,'/row/c121[posi on()=1]')

"ENTITLEMENT_FLAG"

,a."EVENT_STATUS"

,extractValue(a.XMLRECORD,'/row/c123[posi on()=1]')

"ADVICE_TYPE"

Step 5: Explain plan output

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan100' FOR SELECT


RECID FROM "V_FBNK_DIARY" WHERE "EVENT_TYPE" = 'CASH' and
 (/SitePages/Home.aspx) "EVENT_STATUS" = 'AUTHORISED' and "CO_CODE" = 'GB0010001'
ORDER BY RECID
 (/SitePages/T24Intelligence.aspx)
2 ;

 (/TCSPProfileCenter/infodefault.aspx) Explained.
 (/Support/DashBoard.aspx) SQL> SELECT PLAN_TABLE_OUTPUT FROM
TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan100','BASIC'));

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------
-
Plan hash value: 2033843091

-----------------------------------------------------------------------
| Id | Opera on | Name |
-----------------------------------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | SORT ORDER BY | |
| 2 | TABLE ACCESS BY INDEX ROWID|
FBNK_DIARY |
| 3 | INDEX RANGE SCAN |
IX_FBNK_DIARY_EVENT_TYPESTATUS |
-----------------------------------------------------------------------

10 rows selected.

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan101' FOR


SELECT RECID FROM "V_FBNK_DIARY" WHERE "EVENT_TYPE" =
'COUPON' and "EVENT_STATUS" IS NULL and "CO_CODE" = Was this page
'GB0010001' ORDER BY RECID;

Explained. Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 10/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan101','BASIC'));

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------
-
Plan hash value: 2033843091

-----------------------------------------------------------------------
| Id | Opera on | Name |
-----------------------------------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | SORT ORDER BY | |
| 2 | TABLE ACCESS BY INDEX ROWID|
FBNK_DIARY |
| 3 | INDEX RANGE SCAN |
IX_FBNK_DIARY_EVENT_TYPESTATUS |
-----------------------------------------------------------------------
 (/SitePages/Home.aspx)
 (/SitePages/T24Intelligence.aspx) 10 rows selected.
 SQL>

 (/TCSPProfileCenter/infodefault.aspx)
Step 6: Index utilization check 
 (/Support/DashBoard.aspx)
Before indexing:
[DEBUG] 2017-11-20 13:04:57,622 [EX_665246918] JQL  -
JQL    : SSELECT FBNK.DIARY WITH    EVENT.TYPE = "CASH" 
AND    EVENT.STATUS = "AUTHORISED"  AND    CO.CODE =
"GB0010001"
[DEBUG] 2017-11-20 13:04:57,800 [EX_665246918] JQL  -
SQL    : SELECT RECID FROM "V_FBNK_DIARY" WHERE
"EVENT_TYPE" = ? and "EVENT_STATUS" = ? and "CO_CODE"
= ? ORDER BY RECID
[DEBUG] 2017-11-20 13:04:57,967 [EX_665246918] JQL  -
COUNT : 1
+++++++++++
[DEBUG] 2017-11-20 13:05:56,793 [EX_665246918] JQL  -
JQL    : SSELECT FBNK.DIARY WITH    EVENT.TYPE =
"COUPON"  AND    EVENT.STATUS = ""  AND    CO.CODE =
"GB0010001"
[DEBUG] 2017-11-20 13:05:56,949 [EX_665246918] JQL  -
SQL    : SELECT RECID FROM "V_FBNK_DIARY" WHERE
"EVENT_TYPE" = ? and "EVENT_STATUS" IS NULL and
"CO_CODE" = ? ORDER BY RECID
[DEBUG] 2017-11-20 13:05:57,071 [EX_665246918] JQL  -
COUNT : 3
Was this page
After indexing:
SQL> SELECT RECID FROM "V_FBNK_DIARY" WHERE
"EVENT_TYPE" = 'CASH' and "EVENT_STATUS" = Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 11/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

'AUTHORISED' and "CO_CODE" = 'GB0010001' ORDER BY


RECID;

RECID
--------------------------------------------------------------------------------
DIARSC1509724486

Elapsed: 00:00:00.19
SQL> SELECT RECID FROM "V_FBNK_DIARY" WHERE
"EVENT_TYPE" = 'COUPON' and "EVENT_STATUS" IS NULL
and "CO_CODE" = 'GB0010001' ORDER BY RECID;

RECID
--------------------------------------------------------------------------------
DIARSC1509141567
DIARSC1509173060
DIARSC1509176853

Elapsed: 00:00:00.10
 (/SitePages/Home.aspx)
SQL>
 (/SitePages/T24Intelligence.aspx)

 (/TCSPProfileCenter/infodefault.aspx)
Multi value eld indexing in oracle
 (/Support/DashBoard.aspx)
12c

Note:
Please note that if the select which uses indexed multi
value eld contains function like (TO_NUMBER) then the
index will not get utilized. Please note that the below
procedure is a sample reference only.  We suggest you to
get in touch with the DBA for proper implementation and
query optimization upon clear database study. As well as if
the XMLindexing is in place and the elapsed time is still
higher, then get in touch with your database administrator
in order to nd the alternative way to optimise the query
either at database level or please make use of no le
enquiry.

To establish if an XMLIndex index has been used in


resolving a query, the "explain plan" output of the query
needs to be examined. If the index is used, then its path
Was this page
table, order key, or path id will be referenced in the

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 12/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

explain plan. The explain plan will not directly indicate


that a domain index was used; it will not refer to the
XMLIndex index by name.  

Step 1: Select query extraction 

Set the TAFJTrace.properties inside "TAFJ_HOME\conf" directory


to DEBUG for below properties in order to extract the SQL
converted statement for which we are going to index.

 log4j.logger.JQL=DEBUG,      jql

log4j.logger.SQLTRACE=DEBUG, sqltrace

Jql.log:

[DEBUG] 2017-06-01 01:20:59,844 [EX_1611575178] JQL  - SQL    :


SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE 
XMLEXISTS('$t[some $d in c4/text() satis es contains($d,$id)]'
 (/SitePages/Home.aspx) PASSING "NAME_2_4" as "t", ? as "id") ORDER BY "MNEMONIC", 
RECID
 (/SitePages/T24Intelligence.aspx)
 [DEBUG] 2017-06-01 01:21:00,025 [EX_1611575178] JQL  - COUNT :
2
 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx)
Sqltrace.log:

[DEBUG] 2017-06-01 01:20:59,844 [EX_1611575178] SQLTRACE  -


SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE 
XMLEXISTS('$t[some $d in c4/text() satis es contains($d,$id)]'
PASSING "NAME_2_4" as "t", ? as "id") ORDER BY "MNEMONIC", 
RECID:VALUES:SHALINI

Step 2: DDL extraction 

,extractValue(a.XMLRECORD,'/row/c4[posi on()=1]') "NAME_2"

,extract(a.XMLRECORD,'/row/c4') "NAME_2_4"

Step 3: Select query elapsed time before indexing  

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE


XMLEXISTS('$t[some $d in c4/text() satis es
contains($d,$id)]' PASSING "NAME_2_4" as "t", 'SHALINI'
as "id") ORDER BY "MNEMONIC", RECID;
Was this page
RECID
--------------------------------------------------------------------------------
111436
Yes
111433
https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 13/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

111432
111435
111434
111431

6 rows selected.

Elapsed: 00:00:00.16
SQL>

Step 4: Select query elapsed time before indexing  

SQL> declare
  2            indexExists int;
  3            pathIndexed int;
  4  begin
  5      select count(index_name) into indexExists from user_indexes
  6           where table_name = 'FBNK_CUSTOMER' and ityp_name =
 (/SitePages/Home.aspx) 'XMLINDEX';
  7            if indexExists=0 then
 (/SitePages/T24Intelligence.aspx)
  8                                      EXECUTE IMMEDIATE 'create index
 IX_FBNK_CUSTOMER on FBNK_CUSTOMER(XMLRECORD) 
indextype is xdb.xmlinde
 (/TCSPProfileCenter/infodefault.aspx)
x parameters (''PATHS (INCLUDE (/row/c4))'')';
 (/Support/DashBoard.aspx)
  9             else
10              select count(x.path) into pathIndexed from
user_xml_indexes,
11         xmltable ('$t/parameters/paths/path' passing parameters
as "t"
12            columns
13            path  VARCHAR(200)  PATH '.') as x
14              where table_name='FBNK_CUSTOMER' and x.path =
'/row/c4';
15        if pathIndexed=0 then
16                                          EXECUTE IMMEDIATE 'alter index
IX_FBNK_CUSTOMER rebuild parameters (''PATHS (INCLUDE ADD
(/row/c4))'
') ';
17     else
18          raise_application_error(-20010,'XPath already indexed
/row/c4 (NAME.2)');
19     end if;
20    end if;
21  end;
22  /

PL/SQL procedure successfully completed. Was this page

Elapsed: 00:00:00.76
SQL> Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 14/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

SQL> SELECT INDEX_NAME, TYPE, INDEX_TYPE FROM


USER_XML_INDEXES WHERE TABLE_NAME='FBNK_CUSTOMER' ;

INDEX_NAME
--------------------------------------------------------------------------------
TYPE       INDEX_TYPE
---------- ---------------------------
IX_FBNK_CUSTOMER
CLOB       UNSTRUCTURED

SQL>

SQL> select  index_name,index_type from user_indexes where


table_name='FBNK_CUSTOMER';

INDEX_NAME

--------------------------------------------------------------------------------

 (/SitePages/Home.aspx) INDEX_TYPE

 (/SitePages/T24Intelligence.aspx)
---------------------------

 IX_FBNK_CUSTOMER
 (/TCSPProfileCenter/infodefault.aspx)
FUNCTION-BASED DOMAIN
 (/Support/DashBoard.aspx)  

SYS_C0080924

NORMAL

SYS_IL0000253222C00003$$

LOB

SQL>select * from user_xml_indexes where


INDEX_NAME='IX_FBNK_CUSTOMER';

...

...

--------------------------------------------------------------------------------

PARAMETERS

--------------------------------------------------------------------------------

ASYNC     STALE

--------- -----

PEND_TABLE_NAME
Was this page
--------------------------------------------------------------------------------

EX_OR_IN
Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 15/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

--------

SYS339808_IX_FBNK_C_PATH_TABLE

INDEX_NAME

--------------------------------------------------------------------------------

TABLE_OWNER

--------------------------------------------------------------------------------

TABLE_NAME

--------------------------------------------------------------------------------

...

...

Step 5: Explain plan output  


 (/SitePages/Home.aspx)
SQL>EXPLAIN PLAN SET statement_id='ex_plan103' FOR SELECT
 (/SitePages/T24Intelligence.aspx)
RECID FROM "V_FBNK_CUSTOMER" WHERE  (
 XMLEXISTS('$t[some $d in c4/text() satis es contains($d,$id)]'
PASSING "NAME_2_4" as "t", 'SHALINI' as "id")) ORDER BY
 (/TCSPProfileCenter/infodefault.aspx)
"MNEMONIC",  RECID
 (/Support/DashBoard.aspx)
-                          SELECT PLAN_TABLE_OUTPUT FROM
TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan103','BASIC'));

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

Plan hash value: 2059082678

--------------------------------------------------------------------------------

----

| Id  | Operation                                 | Name

   |

--------------------------------------------------------------------------------

----

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

|   0 | SELECT STATEMENT                          |

   |

|   1 |  SORT ORDER BY                            | Was this page

   |

|   2 |   NESTED LOOPS SEMI                       | Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 16/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

   |

|   3 |    NESTED LOOPS                           |

   |

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

|   4 |     VIEW                                  | VW_SQ_1

   |

|   5 |      HASH UNIQUE                          |

   |

|   6 |       HASH JOIN                           |

   |

|    7 |              TABLE ACCESS BY INDEX ROWID BATCHED|


 (/SitePages/Home.aspx)
SYS339808_IX_FBNK_C_PATH_TAB
 (/SitePages/T24Intelligence.aspx)
PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------
 (/TCSPProfileCenter/infodefault.aspx)
LE |
 (/Support/DashBoard.aspx)
|    8 |                INDEX SKIP SCAN                                    |
SYS339808_IX_FBNK_C_PIKEY_IX

   |

|    9 |              TABLE ACCESS BY INDEX ROWID BATCHED|


SYS339808_IX_FBNK_C_PATH_TAB

LE |

|  10 |                INDEX SKIP SCAN                                    |


SYS339808_IX_FBNK_C_PIKEY_IX

   |

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

|  11 |     TABLE ACCESS BY USER ROWID            | FBNK_CUSTOMER

   |

|  12 |      TABLE ACCESS BY INDEX ROWID BATCHED      |


SYS339808_IX_FBNK_C_PATH_TAB

LE |

|  13 |        INDEX RANGE SCAN                                          | Was this page


SYS339808_IX_FBNK_C_PIKEY_IX

   |
Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 17/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

--------------------------------------------------------------------------------

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

20 rows selected.

Elapsed: 00:00:00.25

SQL>

Step 6: Select timing after indexing


  
[DEBUG] 2017-06-01 10:34:03,922 [EX_1644719524] JQL  - JQL    :
SSELECT FBNK.CUSTOMER WITH NAME.2 LIKE "...'SHALINI'..."  BY
MNEMONIC

[DEBUG] 2017-06-01 10:34:03,926 [EX_1644719524] JQL  - SQL    :


SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE 
 (/SitePages/Home.aspx) XMLEXISTS('$t[some $d in c4/text() satis es contains($d,$id)]'
PASSING "NAME_2_4" as "t", ? as "id") ORDER BY "MNEMONIC", 
 (/SitePages/T24Intelligence.aspx)
RECID
 [DEBUG] 2017-06-01 10:34:04,060 [EX_1644719524] JQL  - COUNT :
6
 (/TCSPProfileCenter/infodefault.aspx)
++++++++
 (/Support/DashBoard.aspx) SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE
XMLEXISTS('$t[some $d in c4/text() satis es contains($d,$id)]'
PASSING "NAME_2_4" as "t", 'SHALINI' as "id") ORDER BY
"MNEMONIC", RECID;

RECID
--------------------------------------------------------------------------------
111436
111433
111432
111435
111434
111431

6 rows selected.

Elapsed: 00:00:00.05

Promoted column for multiple


local reference single value eld
Was this page
Step 1: DDL extraction

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 18/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

,extractValue(a.XMLRECORD,'/row/c179[@m="5"]')
"PROS_SALES_OFF"

,extractValue(a.XMLRECORD,'/row/c179[@m="6"]') "PROS_STATUS"

,extractValue(a.XMLRECORD,'/row/c179[@m="7"]')
"CUST_CATEG"

Step 2: DDL extraction

<PROS.SALES.OFF –-> LOCAL.REF<1,5> PROS_SALES_OFF>

create or replace function CUS_LOCAL5(XMLRECORD


SYS.XMLTYPE)

return varchar2 deterministic

as rtnval varchar2(100);

 (/SitePages/Home.aspx) begin

select XMLcast( XMLQuery('/row/c179[@m="5"]/text()' passing


 (/SitePages/T24Intelligence.aspx)
XMLRECORD returning content) as varchar2(100)) into rtnval from

dual;
 (/TCSPProfileCenter/infodefault.aspx)
return rtnval;
 (/Support/DashBoard.aspx)
end;

Function created.

< PROS.STATUS ---> LOCAL.REF<1,6> PROS_STATUS>

create or replace function CUS_LOCAL6(XMLRECORD


SYS.XMLTYPE)

return varchar2 deterministic

as rtnval varchar2(100);

begin

select XMLcast( XMLQuery('/row/c179[@m="6"]/text()' passing


XMLRECORD returning content) as varchar2(100)) into rtnval from
dual;

return rtnval;

end;

/
Was this page
Function created.

 
Yes
<CUST_CATEG ---> LOCAL.REF<1,7> CUST_CATEG>

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 19/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

create or replace function CUS_LOCAL7(XMLRECORD


SYS.XMLTYPE)

return integer deterministic

as

rtnval integer;

begin

select XMLcast( XMLQuery('/row/c179[@m="7"]/text()' passing


XMLRECORD returning content) as integer) into rtnval from dual;

return rtnval;

end;

/Function created.

Step 3: Alter column

 (/SitePages/Home.aspx) Alter the table for the column "PROS_SALES_OFF" using below
command. Make sure to have promoted column name same as
 (/SitePages/T24Intelligence.aspx)
STANDARD.SELECTION eld name in order to update the view

properly.
 (/TCSPProfileCenter/infodefault.aspx)
 
 (/Support/DashBoard.aspx)
SQL> alter table FBNK_CUSTOMER add PROS_SALES_OFF
varchar2(100) generated always as
(cast(CUS_LOCAL5(XMLRECORD) as varchar2(100)));

Table altered.

SQL> alter table FBNK_CUSTOMER add PROS_STATUS


varchar2(100) generated always as
(cast(CUS_LOCAL6(XMLRECORD) as varchar2(100)));

Table altered.

SQL> alter table FBNK_CUSTOMER add CUST_CATEG integer


generated always as (cast(CUS_LOCAL7(XMLRECORD) as integer));

Table altered.

Check for the DESC on the table where the promoted column has
been added.

SQL> DESC FBNK_CUSTOMER;


Was this page
 Name                                      Null?    Type

 ----------------------------------------- -------- ----------------------------


Yes
 RECID                                     NOT NULL VARCHAR2(255)

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 20/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

 XMLRECORD                                    SYS.XMLTYPE

 TASK_ID                                            VARCHAR2(100)

 PROS_SALES_OFF                            VARCHAR2(100)

 PROS_STATUS                                   VARCHAR2(100)

 CUST_CATEG                                      NUMBER(38)

SQL>

Step 4: Index creation

Create index for the altered eld along with constant "1" in order
to make use of index when the column is passed with NULL value.

SQL> CREATE INDEX IX_PROS_SALES_OFF ON


 (/SitePages/Home.aspx) FBNK_CUSTOMER(PROS_SALES_OFF,'1');
 (/SitePages/T24Intelligence.aspx)
Index created.

SQL> CREATE INDEX IX_PROS_STATUS ON
 (/TCSPProfileCenter/infodefault.aspx)
FBNK_CUSTOMER(PROS_STATUS,'1');
 (/Support/DashBoard.aspx) Index created.

SQL> CREATE INDEX IX_CUST_CATEG ON


FBNK_CUSTOMER(CUST_CATEG,'1');

Index created.

Step 5: View updation

Rebuild STANDARD.SELECTION to update the view with promoted


column. Extract the VIEW de nition from oracle database using
below command,

SQL> set long 100000;

SQL> select text from all_views where view_name =


'V_FBNK_CUSTOMER';

Was this page

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 21/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Step 6: Explain plan execution

Execute the explain plan and check whether the SELECT command
is making use of index or not

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan100' FOR SELECT


RECID FROM "V_FBNK_CUSTOMER" WHERE "PROS_SALES_OFF"
='SUGANYA';

Explained.

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan100','BASIC'));

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

Plan hash value: 4195742459

---------------------------------------------------------
 (/SitePages/Home.aspx)
| Id  | Operation                   | Name              |
 (/SitePages/T24Intelligence.aspx)
---------------------------------------------------------

|   0 | SELECT STATEMENT            |                   |
 (/TCSPProfileCenter/infodefault.aspx)
|   1 |  TABLE ACCESS BY INDEX ROWID| FBNK_CUSTOMER     |
 (/Support/DashBoard.aspx)
|   2 |   INDEX RANGE SCAN          | IX_PROS_SALES_OFF |

---------------------------------------------------------

1 rows selected.

EXPLAIN PLAN SET statement_id = 'ex_plan101' FOR SELECT


RECID FROM "V_FBNK_CUSTOMER" WHERE "PROS_STATUS"
='NEW';

Explained.

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan101','BASIC'));

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

Plan hash value: 125768931

------------------------------------------------------

| Id  | Operation                   | Name           |

------------------------------------------------------

|   0 | SELECT STATEMENT            |                |


Was this page
|   1 |  TABLE ACCESS BY INDEX ROWID| FBNK_CUSTOMER  |

|   2 |   INDEX RANGE SCAN          | IX_PROS_STATUS |


Yes
------------------------------------------------------
https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 22/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

9 rows selected.

SQL> EXPLAIN PLAN SET statement_id = 'ex_plan103' FOR SELECT


RECID FROM "V_FBNK_CUSTOMER" WHERE "CUST_CATEG" ='2';

Explained.

SQL> SELECT PLAN_TABLE_OUTPUT FROM


TABLE(DBMS_XPLAN.DISPLAY(NULL, 'ex_plan103','BASIC'));

PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

Plan hash value: 3611061212

-----------------------------------------------------

| Id  | Operation                   | Name          |

-----------------------------------------------------

|   0 | SELECT STATEMENT            |               |

 (/SitePages/Home.aspx) |   1 |  TABLE ACCESS BY INDEX ROWID| FBNK_CUSTOMER |

 (/SitePages/T24Intelligence.aspx)
|   2 |   INDEX RANGE SCAN          | IX_CUST_CATEG |

 -----------------------------------------------------
 (/TCSPProfileCenter/infodefault.aspx)
9 rows selected.
 (/Support/DashBoard.aspx) Elapsed: 00:00:00.02

SQL>

Step 7: Explain plan execution

Test case-1:

Before creating promoted column

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE


"PROS_SALES_OFF"='SUGANYA';

RECID

--------------------------------------------------------------------------------

129039

Elapsed: 00:00:05.18

SQL>

After creating promoted column

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE Was this page


"PROS_SALES_OFF" ='SUGANYA';

RECID
Yes
--------------------------------------------------------------------------------
https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 23/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

129039

Elapsed: 00:00:00.02

SQL>

Test case-2:

Before creating promoted column

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE


"PROS_STATUS" ='NEW';

RECID

--------------------------------------------------------------------------------

129039

Elapsed: 00:00:00.10

SQL>

After creating promoted column


 (/SitePages/Home.aspx)
SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE
 (/SitePages/T24Intelligence.aspx)
"PROS_STATUS" ='NEW';

 RECID
 (/TCSPProfileCenter/infodefault.aspx)
--------------------------------------------------------------------------------
 (/Support/DashBoard.aspx) 129039

Elapsed: 00:00:00.00

Test Case-3:

Before creating promoted column

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE


"CUST_CATEG" ='2';

RECID

--------------------------------------------------------------------------------

129039

1 rows selected

Elapsed: 00:00:01.16

SQL>

After creating promoted column

SQL> SELECT RECID FROM "V_FBNK_CUSTOMER" WHERE


"CUST_CATEG" ='2';

 
Was this page
RECID

--------------------------------------------------------------------------------
Yes
129039

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 24/25
17/9/2019 How to implement 'Promoted Columns' on ORACLE database for TAFJ ?

Elapsed: 00:00:00.00

SQL>

Last Updated:  17-Jun-2019 

  

COPYRIGHT © 2018 TEMENOS HEADQUARTERS SA


(http://www.temenos.com/)
Best viewed in Internet Explorer 10 & above

 (/SitePages/Home.aspx)
 (/SitePages/T24Intelligence.aspx)

 (/TCSPProfileCenter/infodefault.aspx)
 (/Support/DashBoard.aspx)

Was this page

Yes

https://tcsp.temenos.com/HowTo/How_to_implement_promoted_columns_ORACLE_TAFJ.aspx 25/25

You might also like