How Can I Find The Implicit Conversion
(Doc ID 423181.1)
Last updated on MARCH 03, 2022
Applies to:
Oracle Database - Enterprise Edition - Version 8.1.7.4 to 10.2.0.4 [Release 8.1.7 to 10.2]Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
Oracle Server - Enterprise Edition - Version: 8.1.7.4 to 10.2.0.4
This problem can occur on any platform.
Symptoms
How to troubleshoot 'implicit conversion'...
Loss of functionality
----------------------
Implicit conversion is done by Oracle.
Implicit conversion often leads to inferior execution plans.
For example, indexes may become inaccessible.
Significance of loss
---------------------
Possibly inferior execution plans...
Testcase/Examples
==============
example 1:
SQL> variable deptno varchar2(4)
SQL> exec :deptno := '10'
SQL> select * from scott.emp where deptno = :deptno;
SQL> delete from plan_table;
SQL> explain plan for
select * from scott.emp where deptno = :deptno;
SQL> set lines 130
SQL> set head off
SQL> @?/rdbms/admin/utlxpls
Predicate Information (identified by operation id):
2 - access("DEPTNO"=TO_NUMBER(:DEPTNO))
=> The predicate shows the function used in the implicit conversion.
In this case, the index on deptno can be used, as this column is not
converted.
.
example 2:
SQL> variable hiredate char(9)
SQL> exec :hiredate := '03-DEC-81'
SQL> select * from scott.emp where hiredate = :hiredate;
SQL> delete from plan_table;
SQL> explain plan for
select * from scott.emp where hiredate = :hiredate;
SQL> set lines 130
SQL> set head off
SQL> @?/rdbms/admin/utlxpls
Predicate Information (identified by operation id):
1 - filter("HIREDATE"=:HIREDATE)
=> The predicate shows the function used in the implicit conversion.
In this case, the column HIREDATE of the table is modified
and possible index inaccessibility results.
NOTE
=======
These are 2 simple examples. In general, it can be more difficult
to find the implicit conversion from the execution plan predicates.
REFERENCE
---------
PL/SQL User's Guide and Reference
Release 8.1.6
Part Number A77069-01
Datatype Conversion
.
Table 2-1 Implicit Conversions
Implicit versus Explicit Conversion
shows when implicit conversion is done
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |
References |