Home » SQL & PL/SQL » SQL & PL/SQL » Index with max function (merged 3)
Index with max function (merged 3) [message #355043] Wed, 22 October 2008 06:35 Go to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
All,

I am facing one issue with one of the query, need expert advise on this...




         SELECT source_id src_cd, process_cd ,
               MAX (send_sys_ts) last_load_ts
               FROM send_table
          GROUP BY ource_id src_cd, process_cd;


This table is holding around 2 millions rows, and this query takes long to be executed.my question is if I add any index on
send_sys_ts (time stamp field) will it help..?
or if any better way for this...

Please suggest, its critical for me..

thanks,
freakabhi


Index with max function [message #355044 is a reply to message #355043] Wed, 22 October 2008 06:35 Go to previous messageGo to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
All,

I am facing one issue with one of the query, need expert advise on this...


         SELECT source_id src_cd, process_cd ,
               MAX (send_sys_ts) last_load_ts
               FROM send_table
          GROUP BY source_id , process_cd;


This table is holding around 2 millions rows, and this query takes long to be executed.my question is if I add any index on
send_sys_ts (time stamp field) will it help..?
or if any better way for this...

Please suggest, its critical for me..

thanks,
freakabhi


Index with max function [message #355046 is a reply to message #355043] Wed, 22 October 2008 06:38 Go to previous messageGo to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
All,

I am facing one issue with one of the query, need expert advise on this...


         SELECT source_id src_cd, process_cd ,
               MAX (send_sys_ts) last_load_ts
               FROM send_table
          GROUP BY source_id , process_cd;


This table is holding around 2 millions rows, and this query takes long to be executed.my question is if I add any index on
send_sys_ts (time stamp field) will it help..?
or if any better way for this...

Please suggest, its critical for me..

thanks,
freakabhi


Re: Index with max function [message #355059 is a reply to message #355046] Wed, 22 October 2008 07:24 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, but an index on source_id src_cd, process_cd and send_sys_ts may help.

Regards
Michel
Previous Topic: Oracle useing Cross join
Next Topic: query to find the values which are not in IN clause
Goto Forum:
  


Current Time: Sat Dec 10 20:18:35 CST 2016

Total time taken to generate the page: 0.09999 seconds