I create a view with many joins. I want to group the resultset by some of the fields I selected.
Does setting indices on these fields increases the performance of the query? I'm using MS SQL Server, but it should be nearly the same for all dbs, shouldn't it?
SELECT table1.field1, table1.field2, table2.field1
FROM table1
INNER JOIN table2 ON table1.primkey = table2.tablekey
GROUP BY table1.field1, table1.field2, table2.field1