Link to home
Start Free TrialLog in
Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda

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
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Since this question is unrelated to SQL Server 2008, please have that Topic removed.
Avatar of Anthony Matovu

ASKER

Hi Anthony

It is an SQL statement which I am running in oracle

Anthony
ASKER CERTIFIED SOLUTION
Avatar of Alex [***Alex140181***]
Alex [***Alex140181***]
Flag of Germany 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
Try these below SQL
select * from "very large oracle database" where first_date =to_date('2014-04-01','YYYY-MM-DD');
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
Thank you all,

with praveencpk's post it executes in less than a minute.

Thank you again

Anthony