Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-07-02 Thread Robert Haas
On Thu, Jun 28, 2012 at 10:22 PM, Etsuro Fujita fujita.ets...@lab.ntt.co.jp wrote: Honestly, I'm not sure that it's worth including this, considering the use case... Since nobody seems crazy about pursuing this, I'm marking this patch Rejected. -- Robert Haas EnterpriseDB:

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-07-02 Thread Ants Aasma
On Mon, Jul 2, 2012 at 5:33 PM, Robert Haas robertmh...@gmail.com wrote: On Thu, Jun 28, 2012 at 10:22 PM, Etsuro Fujita fujita.ets...@lab.ntt.co.jp wrote: Honestly, I'm not sure that it's worth including this, considering the use case... Since nobody seems crazy about pursuing this, I'm

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-28 Thread Etsuro Fujita
Hi Ants, -Original Message- From: Ants Aasma [mailto:a...@cybertec.at] Sent: Wednesday, June 27, 2012 9:23 PM To: Robert Haas Cc: Etsuro Fujita; Jay Levitt; Tom Lane; PostgreSQL-development; Francois Deliege Subject: Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-27 Thread Ants Aasma
Sorry about the delay in answering. I have been swamped with non-PG related things lately. On Tue, Jun 26, 2012 at 11:08 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Jun 22, 2012 at 10:12 AM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jun 19, 2012 at 5:41 AM, Etsuro Fujita

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-26 Thread Robert Haas
On Fri, Jun 22, 2012 at 10:12 AM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jun 19, 2012 at 5:41 AM, Etsuro Fujita fujita.ets...@lab.ntt.co.jp wrote: I'm confused by this remark, because surely the query planner does it this way only if there's no LIMIT.  When there is a LIMIT, we

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-26 Thread Etsuro Fujita
Hi, -Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Wednesday, June 27, 2012 5:09 AM To: Etsuro Fujita Cc: Ants Aasma; Jay Levitt; Tom Lane; PostgreSQL-development; Francois Deliege Subject: Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-22 Thread Robert Haas
On Tue, Jun 19, 2012 at 5:41 AM, Etsuro Fujita fujita.ets...@lab.ntt.co.jp wrote: I'm confused by this remark, because surely the query planner does it this way only if there's no LIMIT.  When there is a LIMIT, we choose based on the startup cost plus the estimated fraction of the total cost we

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-19 Thread Etsuro Fujita
Hi, -Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Tuesday, June 19, 2012 3:12 AM To: Ants Aasma Cc: Etsuro Fujita; Jay Levitt; Tom Lane; PostgreSQL-development; Francois Deliege Subject: Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-18 Thread Robert Haas
On Fri, Jun 15, 2012 at 9:22 AM, Ants Aasma a...@cybertec.at wrote: Exactly. I think the first question for this patch should be whether this use-case is worth the complexity of the patch. I can't imagine any really compelling use cases that need an arbitrary distinct subset of results. Me

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-15 Thread Etsuro Fujita
Hi, I would like to ask a question before looking into the patch. At 21:56 12/03/30 -0400, Jay Levitt wrote: Tom Lane wrote: Ants Aasmaa...@cybertec.at 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

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-15 Thread Robert Haas
On Fri, Jun 15, 2012 at 6:55 AM, Etsuro Fujita fujita.ets...@lab.ntt.co.jp wrote: 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

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-06-15 Thread Ants Aasma
On Fri, Jun 15, 2012 at 3:13 PM, Robert Haas robertmh...@gmail.com wrote: However, as Ants points out, we could make it work better for the special case where we're not actually doing any aggregation, because in that case we can emit the row for each group when the group is created, rather

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-03-30 Thread Jay Levitt
Tom Lane wrote: Ants Aasmaa...@cybertec.at 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

Re: [HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-03-28 Thread Tom Lane
Ants Aasma a...@cybertec.at 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

[HACKERS] [PATCH] Lazy hashaggregate when no aggregation is needed

2012-03-27 Thread Ants Aasma
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. The planner is modified so that