RE: pg_publication_tables show dropped columns

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: pg_publication_tables show dropped columns
Date: 2022-09-06 07:57:43
Message-ID: OS0PR01MB571610CCAB5763BCBC5976E8947E9@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, September 6, 2022 11:13 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> writes:
> > Just trying the new column/row filter on v15, I found this issue that
> > could be replicated very easily.
>
> Bleah. Post-beta4 catversion bump, here we come.

Oh, Sorry for the miss.

> > This could be solved by adding a "NOT attisdropped", simple patch
> > attached.
>
> That view seems quite inefficient as written --- I wonder if we can't do better by
> nuking the join-to-unnest business and putting the restriction in a WHERE
> clause on the pg_attribute scan.
> The query plan that you get for it right now is certainly awful.

I agree and try to improve the query as suggested.

Here is the new version patch.
I think the query plan and cost looks better after applying the patch.

Best regards,
Hou zj

Attachment Content-Type Size
v2-0001-Ignore-dropped-columns-in-pg_publication_tables.patch application/octet-stream 2.7 KB
query_plans.txt text/plain 4.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2022-09-06 08:02:36 Re: [RFC] building postgres with meson - v12
Previous Message Daniel Gustafsson 2022-09-06 07:51:43 Re: Return value of PathNameOpenFile()