[PERFORM] Additional select fields in a GROUP BY

2004-06-12 Thread Vitaly Belman
Hello, Consider the following query: select t1field1, avg(t2fieild2) from t1, t2 where t1.field1 = t2.field2 group by t1field1 That works fine. But I'd really like to see more fields of t1 in this query, however I can't add them into the select because they're not part of the GROUP BY, thus I ha

Re: [PERFORM] Additional select fields in a GROUP BY

2004-06-12 Thread Tom Lane
Vitaly Belman <[EMAIL PROTECTED]> writes: > The problem is that addind them all to GROUP BY causes a performance > loss. Really? I'd think that there'd be no visible loss if the earlier fields of the GROUP BY are already unique. The sort comparison should stop at the first field that determines