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

From: "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: "'Robert Haas'" <robertmhaas(at)gmail(dot)com>
Cc: "'Ants Aasma'" <ants(at)cybertec(dot)at>, "'Jay Levitt'" <jay(dot)levitt(at)gmail(dot)com>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org>, "'Francois Deliege'" <fdeliege(at)gmail(dot)com>
Subject: Re: [PATCH] Lazy hashaggregate when no aggregation is needed
Date: 2012-06-27 03:53:40
Message-ID: 003e01cd5418$706dba40$51492ec0$@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> -----Original Message-----
> From: Robert Haas [mailto:robertmhaas(at)gmail(dot)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 is
needed
>
> On Fri, Jun 22, 2012 at 10:12 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > On Tue, Jun 19, 2012 at 5:41 AM, Etsuro Fujita
> > <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)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 expect
> >>> to pay based on dividing the LIMIT by the overall row count estimate.  Or
> >>> is this not what you're talking about?
> >>
> >> I think that Ants is pointing the way of estimating costs in
> >> choose_hashed_grouping()/choose_hashed_distinct(), ie cost_agg() for
> >> cheapest_path + hashagg, where the costs are calculated based on the total
> >> cost only of cheapest_path.  I think that it might be good to do cost_agg()
> >> for the discussed case with the AGG_SORTED strategy, not the AGG_HASHED
> >> strategy.
> >
> > Well, Ants already made some adjustments to those functions; not sure
> > if this means they need some more adjustment, but I don't see that
> > there's a general problem with the costing algorithm around LIMIT.
>
> Ants, do you intend to update this patch for this CommitFest? Or at
> all? It seems nobody's too excited about this, so I'm not sure
> whether it makes sense for you to put more work on it. But please
> advise as to your plans.

Please excuse my slow response, I would also like to know your plan.

Best regards,
Etsuro Fujita

> Thanks,
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-06-27 04:00:49 Re: Posix Shared Mem patch
Previous Message Qi Huang 2012-06-27 03:41:32 Optimizer Path Candidates difference in 9.1.3 and 9.2 beta1