var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
There are two tables t1 with column c1 and t2 with column c2.
Both the cloumn type are same and both tables have same number of rows.
Consider this query.
select avg(c1) from t1
select avg(c2) from t2
Can anyone tell me which query runs faster?
What about other aggregate functions like max and min?
both queries will run equally fast if we assume that other factors like network speed, load on server etc are the same.
avg : this query will result in a table scan
min/max : if there is no index on the table, it will result in a table scan. however if there is an unique index on the column, reading the start/end of the index should provide the result.