Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Java processing vs. DB Processing

Author  Topic 

mukhan85
Starting Member

46 Posts

Posted - 2009-06-23 : 16:10:36
Hi all,
I need to choose one of the following:
I need to get statistics about some data, there is table with schema:
create table performance(ID int, duration seconds)
I need to calculate average duration for each type of ID.

Which would be faster, calculating average with sql query or get all data into java collection and then calculating the average?

I realize that I will need to use GROUP BY in case of SQL computation, and I am not sure what is complexity of Group By?

Thanks.
   

- Advertisement -