Link to home
Start Free TrialLog in
Avatar of gram77
gram77Flag for India

asked on

Full table scan of a partitioned table.

I have a table partitioned by date.

I have a select statement on which the oracle optimizer decides to do  a full table scan  across all partitions why?
Avatar of gram77
gram77
Flag of India image

ASKER

select *
from mytable
where to_date(date, 'dd-mm-yyyy') = to_date(v_date, 'dd-mm-yyyy');

However, the optimiser decides to do a partition scan on the following statement:

select *
from mytable
where date = to_date(v_date, 'dd-mm-yyyy');

why?
Avatar of Wasim Akram Shaik
its simple because the partition is on date column not on to_date(date, 'dd-mm-yyyy')
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial