agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Jay Levitt <[email protected]>
To: Tom Lane <[email protected]>
Cc: Ants Aasma <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: Francois Deliege <[email protected]>
Subject: Re: [PATCH] Lazy hashaggregate when no aggregation is needed
Date: Fri, 30 Mar 2012 21:56:36 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CA+CSw_uE-RCyQd_bXJNe=usrXkq+keFrQrahkc+8ou+Ws4Y=Vw@mail.gmail.com>
	<[email protected]>

Tom Lane wrote:
> Ants Aasma<[email protected]> writes:
>> A user complained on pgsql-performance that SELECT col FROM table
>> GROUP BY col LIMIT 2; performs a full table scan. ISTM that it's safe
>> to return tuples from hash-aggregate as they are found when no
>> aggregate functions are in use. Attached is a first shot at that.
>
> As I commented in the other thread, the user would be a lot better off
> if he'd had an index on the column in question. I'm not sure it's worth
> complicating the hashagg logic when an indexscan + groupagg would
> address the case better.

Would this patch help in the case where "table" is actually a set-returning 
function, and thus can't have an index? (I don't yet know enough about the 
tree to know when hashaggs get used). I'm wondering if this is a useful 
exception to the "restrictions can't get pushed down through GROUP BYs" rule.

Jay



view thread (16+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Lazy hashaggregate when no aggregation is needed
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox