Home » SQL & PL/SQL » SQL & PL/SQL » How to tune SQL query
How to tune SQL query [message #19957] Sun, 21 April 2002 18:31 Go to next message
Rajesh Mohan
Messages: 3
Registered: April 2002
Junior Member
Hi,
Sorry for giving wrong query in my last message. I am using max() not sum(). Actually my query is

select roll_no,max(expiry_date) from v_master
group by roll_no
having max(expiry_date)<=sysdate;

Thia v_master table is having 6 million records and this query is taking more than 4 minutes.
roll_no is of number datatype and expiry_date is date datatype.
Please provide me some solution to make it fast.

Thanks & Regards
Rajesh Mohan
Re: How to tune SQL query [message #19963 is a reply to message #19957] Mon, 22 April 2002 00:20 Go to previous message
Mike
Messages: 417
Registered: September 1998
Senior Member
An index with the fields roll_no and expiry_date would probably imporve your query.

Hope that helps
Mike
Previous Topic: INSERT MULTIPLE DATA USING A SINGLE STATEMENT
Next Topic: where are the tables get created by default
Goto Forum:
  


Current Time: Tue Apr 23 19:52:17 CDT 2024