Performance of the sql due to group by [message #150450] |
Wed, 07 December 2005 23:18 |
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 |
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
|
|
|