Re: Partial aggregates pushdown

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
Subject: Re: Partial aggregates pushdown
Date: 2021-10-21 21:43:38
Message-ID: CALNJ-vTQ-kUz0OE7ZBoo-C7sviUv4Sp8HGR0s9wKi8EoW5ZxKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
w.r.t. 0001-Partial-aggregates-push-down-v03.patch

For partial_agg_ok(),

+ if (agg->aggdistinct || agg->aggvariadic || agg->aggkind !=
AGGKIND_NORMAL || agg->aggorder != NIL)
+ ok = false;

Since SearchSysCache1() is not called yet, you can return false directly.

+ if (aggform->aggpartialpushdownsafe != true)

The above can be written as:

if (!aggform->aggpartialpushdownsafe)

For build_conv_list():

+ Oid converter_oid = InvalidOid;
+
+ if (IsA(tlentry->expr, Aggref))
...
+ }
+ convlist = lappend_oid(convlist, converter_oid);

Do you intend to append InvalidOid to convlist (when tlentry->expr is
not Aggref) ?

Cheers

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-10-21 21:45:11 Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?
Previous Message Thomas Munro 2021-10-21 21:42:23 Re: Thinking about ANALYZE stats and autovacuum and large non-uniform tables