Re: Trouble with hashagg spill I/O pattern and costing

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, HeikkiLinnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Trouble with hashagg spill I/O pattern and costing
Date: 2020-05-29 13:04:54
Message-ID: 20200529130454.el6qyuukj3ofs4eu@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 28, 2020 at 06:14:55PM -0700, Jeff Davis wrote:
>On Thu, 2020-05-28 at 20:57 +0200, Tomas Vondra wrote:
>> Attached is a patch adding CP_SMALL_TLIST to create_agg_plan and
>> create_groupingsets_plan.
>
>Looks good, except one question:
>
>Why would aggstrategy ever be MIXED when in create_agg_path? Wouldn't
>that only happen in create_groupingsets_path?
>

Ah, right. Yeah, we only need to check for AGG_HASH here. Moreover,
AGG_MIXED probably does not need the tlist tweak, because the input
should be pre-sorted as with AGG_SORTED.

And we should probably do similar check in the create_groupinsets_path,
I guess. At first I thought we can't do that before inspecting rollups,
which only happens later in the function, but now I see there's
aggstrategy in GroupingSetsPath too.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
hashagg-tlist-fix-v2.patch text/plain 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2020-05-29 13:13:26 Re: password_encryption default
Previous Message Darafei Komяpa Praliaskouski 2020-05-29 12:56:41 Re: feature idea: use index when checking for NULLs before SET NOT NULL