Message from: srinivas27_750
Hi All,
We are using Oracle 10.2.0.5, AIX O.S.
We partitioned our transaction tables on a date column, i.e. we created monthly
partitions.
When we are running a SQL in SQL*Plus, Oracle is not returning data when our
condition requires to get the data from 2 partitions.
For Example:
SELECT
WHERE settlement_date BETWEEN ‘28-JUN-10’ AND ‘02-JUL-10’
Oracle needs to bring the data from Jun '10 and Jul '01 partitions. But
when we modify the SQL to include to_date function around the dates, oralce
returns the data.
SELECT
WHERE settlement_date BETWEEN to_date(‘28-JUN-10’, ‘dd-mon-yy’)
AND to_date(‘02-JUL-10’, ‘dd-mon-yy’)
Our DB default date format is dd-mon-yy, we also tried with YYYY format, but no
luck.
Our actual SQL includes many other conditions.
Our observations:
- If we use only one condition on the partitioned column, DB returns data.
- If we use all other conditions (around 10 conditions), along with the
condition on the partitioned column, DB doesn’t return data. - If we modify the SQL to include to_date function, DB returns data.
- If we change the end date to ‘31-dec-2099’, then DB returns data. In
this case, oracle needs to scan the entire table.
Oracle is choosing different execution plan with to_date function and without
to_date function.
In one of Oracle documentation, we found that Oracle recommends to use to_date
function when we partition tables on a date column. They didn’t mention that
it is mandatory to use to_date function.
Anybody ran into the similar problem?, and did you resolve it without using the
to_date function?
We are using Business Objects Reports, if we need to use to_date function, then
we can’t use some of the Business Objects features, and we need to use those
features, so we are looking for a solution which doesn’t require to_date
function.
Thank you in advance.
Srini.
Historical Messages
Author: srinivas27_750
Date: Mon Dec 27 08:49:37 PST 2010
Hi All,
We are using Oracle 10.2.0.5, AIX O.S.
We partitioned our transaction tables on a date column, i.e. we created monthly
partitions.
When we are running a SQL in SQL*Plus, Oracle is not returning data when our
condition requires to get the data from 2 partitions.
For Example:
SELECT
WHERE settlement_date BETWEEN ‘28-JUN-10’ AND ‘02-JUL-10’
Oracle needs to bring the data from Jun '10 and Jul '01 partitions. But
when we modify the SQL to include to_date function around the dates, oralce
returns the data.
SELECT
WHERE settlement_date BETWEEN to_date(‘28-JUN-10’, ‘dd-mon-yy’)
AND to_date(‘02-JUL-10’, ‘dd-mon-yy’)
Our DB default date format is dd-mon-yy, we also tried with YYYY format, but no
luck.
Our actual SQL includes many other conditions.
Our observations:
- If we use only one condition on the partitioned column, DB returns data.
- If we use all other conditions (around 10 conditions), along with the
condition on the partitioned column, DB doesn’t return data. - If we modify the SQL to include to_date function, DB returns data.
- If we change the end date to ‘31-dec-2099’, then DB returns data. In
this case, oracle needs to scan the entire table.
Oracle is choosing different execution plan with to_date function and without
to_date function.
In one of Oracle documentation, we found that Oracle recommends to use to_date
function when we partition tables on a date column. They didn’t mention that
it is mandatory to use to_date function.
Anybody ran into the similar problem?, and did you resolve it without using the
to_date function?
We are using Business Objects Reports, if we need to use to_date function, then
we can’t use some of the Business Objects features, and we need to use those
features, so we are looking for a solution which doesn’t require to_date
function.
Thank you in advance.
Srini.
__