Home » RDBMS Server » Performance Tuning » Performance of the sql due to group by
Performance of the sql due to group by [message #150450] Wed, 07 December 2005 23:18 Go to next message
raghuraja_r
Messages: 22
Registered: February 2005
Location: chennai
Junior Member

Hi
I have a table of 1 lakh records

select category, dept, sum(salary)
from emp
group by dept,category

modified

select category, dept, sum(salary),location
from emp
group by dept,category,location

will there be any difference in the performance of the above sqls
does both the sqls take same time to execute
or the 2nd will be slower than the 1st.
if so why.

can you please help me out in this

Thanks
Raghu Raja
Re: Performance of the sql due to group by [message #150460 is a reply to message #150450] Thu, 08 December 2005 00:20 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Since these queries give completely different results, it is hard to say what the impact will be. Maybe no difference, maybe faster (if there is an index on location, category, dept), maybe slower (more rows to be returned).
100,000 records (please use normal numbers instead of 'lakh', since the rest of the world doesn't use that word) is peanuts for a query like that anyway.

hth
Previous Topic: Explain Plan (Query Transformation)
Next Topic: Tablespace increase - Which is Optimum Method.
Goto Forum:
  


Current Time: Fri Mar 29 01:36:53 CDT 2024