Anthony Matovu
asked on
oracle query is slow to execute
I am interested in loading customers who first used a service on the 1st april 2014.
I am using the table below, but it is slow to execute taking like one hour.
first_date is a date field. I have another date but stored as number YYYYMMDD not exactly the same as first_date in value. when I use the field saved as a number the quesry runs in less than 3 minutes.
I am using PLSQL Developer
select * from "very large oracle database" where to_char(first_date,'YYYY-MM-DD')='2014-04-01 ';
I would want to improve speed on this query
the database is so huge
Thank you
Anthony
I am using the table below, but it is slow to execute taking like one hour.
first_date is a date field. I have another date but stored as number YYYYMMDD not exactly the same as first_date in value. when I use the field saved as a number the quesry runs in less than 3 minutes.
I am using PLSQL Developer
select * from "very large oracle database" where to_char(first_date,'YYYY-MM-DD')='2014-04-01
I would want to improve speed on this query
the database is so huge
Thank you
Anthony
Since this question is unrelated to SQL Server 2008, please have that Topic removed.
ASKER
Hi Anthony
It is an SQL statement which I am running in oracle
Anthony
It is an SQL statement which I am running in oracle
Anthony
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try these below SQL
select * from "very large oracle database" where first_date =to_date('2014-04-01','YYY Y-MM-DD');
select * from "very large oracle database" where first_date =to_date('2014-04-01','YYY
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all,
with praveencpk's post it executes in less than a minute.
Thank you again
Anthony
with praveencpk's post it executes in less than a minute.
Thank you again
Anthony