Database Tuning (MOSC)

MOSC Banner

CPU costing - Simple query

edited Oct 30, 2009 2:47AM in Database Tuning (MOSC) 9 commentsAnswered ✓
Hi everybody,

I am testing a simple query in 10g (10.2.0.4). I don´t have system statistics in the database. The column indicavisible of the table test1 is char(1).

I run the same query two times but the second case has an implicit conversion:

select * from test1 where indicavisible='0';

select * from  test1 where indicavisible=0;

The cpu_cost for the first case is greater than second. The output is:

First query:

OPERATION                        CPU_COST FILTER_PREDICATES
------------------------------ ---------- ----------------------------------------
SELECT STATEMENT
TABLE ACCESS                     44753683 "INDICAVISIBLE"='0'

Second query:

OPERATION                        CPU_COST FILTER_PREDICATES
------------------------------ ---------- ----------------------------------------
SELECT STATEMENT
TABLE ACCESS                     37031903 TO_NUMBER("INDICAVISIBLE")=0

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center