Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE
Date: 2026-10-05 06:57:40
Message-ID: CAF0whufYksvfRiq9V3LF+o7s-Ts8ERxHSj6cVryN52-jnvmFqQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 1, 2026 at 5:32 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> I attached a rebased v2 since v1 no longer applies on master.
>
> I kept both 0001 and 0002 for now since the other thread including
> 0001 is also still under discussion.
Dear Zsolt,

I tested the rebased v2 patches on the latest master.
Both patches applied cleanly, and I tested the statistics-target
preservation during ALTER TABLE ALTER COLUMN TYPE.

0001 – Preserve statistics target of extended statistics-Verified that
a column statistics target set to 500 remained 500 after changing the
column type from int to bigint.
0002 – Preserve statistics targets of indexes rebuilt by ALTER
TABLE-Verified that an expression index statistics target set to 400
remained 400 after changing the underlying column type from text to
varchar(100).
Both test cases passed, and the configured statistics targets were
preserved after the type changes.

Regards,
solai

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mario Karuza 2026-10-05 06:59:20 Re: tuplesort_putdatum() does not account for tuple memory
Previous Message Michael Paquier 2026-10-05 06:49:16 Re: pgstat: allow a stats kind to use its own dedicated dsa/dshash