Re: BUG #18568: BUG: Result wrong when do group by on partition table! - Mailing list pgsql-bugs

From jian he
Subject Re: BUG #18568: BUG: Result wrong when do group by on partition table!
Date
Msg-id CACJufxGeTcuRDM2OEq464bHmeuKiLz21GzFX+p7SDrMqi+9Pug@mail.gmail.com
Whole thread Raw
In response to 回复: BUG #18568: BUG: Result wrong when do group by on partition table!  ("狂奔的蜗牛" <1105066510@qq.com>)
Responses Re: BUG #18568: BUG: Result wrong when do group by on partition table!
List pgsql-bugs
On Wed, Aug 7, 2024 at 9:08 PM 狂奔的蜗牛 <1105066510@qq.com> wrote:
>
> I readd RelabelType to branch in v5 patch, and add case to cover the code.
>
> In new adding case: `SELECT c collate "C", count(c) FROM pagg_tab3 GROUP BY c collate "C" HAVING count(c) > 1 ORDER
BY1;` 
> According to original logic, group_by_has_partkey() will return false, it will lead to cannot do having filter in sub
table,the result is correct but the performance is poor. 
> Our logic will get better performance.
>
>
> About InvalidOid collation, non-character type's collation is 0(InvalidOid) always.
>

src/test/regress/sql/partition_aggregate.sql
suppose to run with or without ICU, your new test requires ICU,
which will make some buildfarm fail?

put the test to src/test/regress/sql/collate.icu.utf8.sql
seems a little bit of strange.



also. see beginning of partition_aggregate.sql
-- Note: to ensure plan stability, it's a good idea to make the partitions of
-- any one partitioned table in this test all have different numbers of rows.

you may want to adjust the pagg_tab3 partitions rows.



some white space error.
git diff --check
src/backend/optimizer/plan/planner.c:8041: trailing whitespace.
+                                        * Set collation in group by
clause using COLLATE syntax,
src/backend/optimizer/plan/planner.c:8051: trailing whitespace.
+                                       }



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18573: Analyze command consumes several GB of memory - more than analyzed table size
Next
From: PG Bug reporting form
Date:
Subject: BUG #18576: Using EXPLAIN (VERBOSE) in information_schema.element_types returns ERROR: failed to find plan for