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
Messages: 22
Registered: February 2005
Location: chennai
Junior Member

I have a table of 1 lakh records

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


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

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
Messages: 7897
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.

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

Current Time: Fri Dec 09 12:40:03 CST 2022