Re: fdw: foreign partition and aggregate function

From: Jérémy Lal <kapouer(at)melix(dot)org>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: fdw: foreign partition and aggregate function
Date: 2026-05-12 08:09:46
Message-ID: CAJxTCxw6X4G8wpW-41Md0sf5pn=aVCLXC9=H71v_xLa5_xnGPA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le dim. 10 mai 2026 à 04:51, Ron Johnson <ronljohnsonjr(at)gmail(dot)com> a écrit :

> On Sat, May 9, 2026 at 5:49 AM Jérémy Lal <kapouer(at)melix(dot)org> wrote:
>
>> Hi,
>>
>> Using PostgreSQL on Debian 18.3-1.pgdg13+1
>>
>> I've setup a partitioned table, with local and foreign partitions like
>> this
>> Clé de partition : LIST (part_id)
>> Partitions: foreign_parts_s1.mytable_1 FOR VALUES IN (1), FOREIGN,
>> parts_s10.mytable_10 FOR VALUES IN (10), PARTITIONED,
>>
>> and ran ANALYZE mytable;
>>
>
> pg_stat_all_tables will tell you if remote parts_s1.mytable_1 was really
> analyzed.
>

Thanks, I searched into that direction.
pg_stat_all_tables doesn't have any stat regarding parts_s1.mytable_1:
SELECT relname FROM pg_stat_all_tables WHERE relname LIKE '%mytable%';
only returns relname my_table, mytable_10

Anyway, analyze verbose reports nothing suspicious, with entry like
INFO: analyzing "foreign_parts_s1.mytable_1"
INFO: "mytable_1": table contains 6320 rows, 6320 rows in sample
INFO: finished analyzing table "mydb.foreign_parts_s1.mytable_1"

mydb=# SELECT
schemaname, tablename, attname, inherited, n_distinct, most_common_vals
FROM pg_stats WHERE tablename = 'mytable' AND attname = 'part_id';
-[ RECORD 1
]-----+----------------------------------------------------------------------
schemaname | public
tablename | mytable
attname | part_id
inherited | t
n_distinct | 1
most_common_vals | {10}

most_common_vals only list local partition's list value.
That seems not okay.

To be honest, the partitions are themselves partitioned with another
column, so maybe it causes an issue.

Jérémy

>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2026-05-12 16:31:26 Re: Problem linking with Release library
Previous Message Igor Korot 2026-05-12 07:10:24 Re: Problem linking with Release library