public inbox for [email protected]
help / color / mirror / Atom feedFrom: Amit Langote <[email protected]>
To: jian he <[email protected]>
Cc: Junwang Zhao <[email protected]>
Cc: Tender Wang <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Subject: Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.
Date: Fri, 8 Nov 2024 18:27:32 +0900
Message-ID: <CA+HiwqGKn4Nn0QbtG8MpknW=uMZ+kcQ=VbCteXVaO9bHZFkoEQ@mail.gmail.com> (raw)
In-Reply-To: <CACJufxGkn_CKadcztYxOu39MpgDAGzHq3upR5h834xKeT-2SbA@mail.gmail.com>
References: <CAHewXNno_HKiQ6PqyLYfuqDtwp7KKHZiH1J7Pqyz0nr+PS2Dwg@mail.gmail.com>
<CAHewXN=sGCF7cp3r+8PyZXP0TT+Q1imoEe-7Z-0Sxxb76eWAXg@mail.gmail.com>
<CA+HiwqFmtOjVX0Gy2HCMGDRJg3zKNmhdt=o=K=pTvE2VhEe-1A@mail.gmail.com>
<CAHewXNk1K2G56C7kXvuYzQexeQs2EuHA3x-7v68ihn843svEZQ@mail.gmail.com>
<CACJufxFefXhnD+Z3swU9A0SCK3AfmEbTSx7hj=TCu-0hr2OOgA@mail.gmail.com>
<CAHewXNnoTXxsAuJKxEjs-TASjG_-soH9Y_+tup8a5teggS4caw@mail.gmail.com>
<CACJufxF1bmHSc+L7Hg7QxnH9UDbyP+qMsK8Z2ZBU8kux6C=t3A@mail.gmail.com>
<CAEG8a3Ks7_5b+0bnqbSceAbofj=o1RmP4qedv1Jr43Nz1wY-vA@mail.gmail.com>
<CA+HiwqEHx++qTjCGmWyYZDiPR=_fLGPjR7RcFEVnSNZVc-Qj2g@mail.gmail.com>
<CACJufxG1pKrjf+_ugjYJFmww_kGd9Wn8OpU=XoH5w2hUqSXFbg@mail.gmail.com>
<CA+HiwqEQHVbAdFWNcrnDEZXk=m-Mk5ZtCoFq_tKkyoHPRATuag@mail.gmail.com>
<CACJufxGjLcpNLh75_YSbXXmfaTyKSU+P0rs8M293VYa276QQdQ@mail.gmail.com>
<CA+HiwqH_XkE2RyYtU_TKfASeV7+q3GLDzM3ssH7pc0eu5Fh-fw@mail.gmail.com>
<CACJufxHAnGh75sp6Df=jrOiZifHUJSJq_d4XhEhw=vULC66U+A@mail.gmail.com>
<CA+HiwqHv+7gp+SPfE-=+KYmvrcVWryz+F5HNG2Rb6=UZL_A+OQ@mail.gmail.com>
<CACJufxGkn_CKadcztYxOu39MpgDAGzHq3upR5h834xKeT-2SbA@mail.gmail.com>
Hi,
On Wed, Nov 6, 2024 at 12:19 PM jian he <[email protected]> wrote:
> looks good to me.
> I didn't find any issue.
Thanks for the review.
> group_by_has_partkey can even cope with:
> EXPLAIN (COSTS OFF, settings)
> SELECT c collate "C" collate case_insensitive collate "C", count(c)
> FROM pagg_tab3 GROUP BY c collate "C" collate case_insensitive collate
> "C" ORDER BY 1;
>
> so i guess in group_by_has_partkey
> if (IsA(groupexpr, RelabelType))
> groupexpr = ((RelabelType *) groupexpr)->arg;
> should be enough.
>
> not need while loop.
>
> while (IsA(groupexpr, RelabelType))
> groupexpr = (Expr *) (castNode(RelabelType, groupexpr))->arg;
Added a comment about that.
Pushed both patches after making changes to 0001 to allow "partial"
partitionwise aggregation after all. The differences in output with
partial partitionwise aggregation and no partitionwise aggregation
that I mentioned before don't seem to have anything to do with
partitionwise aggregation, but apparently with whether aggregation was
hashed or not. I confirmed that by turning enable_hashagg on and off
to see the difference. Changing enable_partitionwise_aggregate for
either of the values of enable_hashagg didn't change the plan.
Thank you all for working on this.
--
Thanks, Amit Langote
view thread (15+ messages)
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], [email protected], [email protected]
Subject: Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.
In-Reply-To: <CA+HiwqGKn4Nn0QbtG8MpknW=uMZ+kcQ=VbCteXVaO9bHZFkoEQ@mail.gmail.com>
* 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