Re: Should we skip foreign key checks in binary upgrade mode?

From: Manu <manuelreyesbravo(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: Should we skip foreign key checks in binary upgrade mode?
Date: 2026-12-05 05:10:08
Message-ID: 179644740862.198062.12120400326009697263@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Following up on the constraint-naming discussion from Nov 25,
Heikki wrote:

> Playing with that schema, I noticed a lot of time is also spent in
> ChooseConstraintName().

Nathan replied:

> Are you thinking of this one [0]?

I tried v1 of that patch [0] on the smaller tier of David's schema,
with 91,678 pg_class rows. The baseline included 00f270198, the
foreign-key validation change discussed in this thread.

I profiled one pg_upgrade --no-sync run per build with perf. On the
baseline, ChooseConstraintName() and its callees accounted for 1.57%
of all user-space instruction samples during schema restore. With
v1, the corresponding inclusive share for
ChooseConstraintNameExtended() was 0.06%.

I've attached the two perf report excerpts for the schema restore
phase. The percentages above are from the Children column.

[0] https://postgr.es/m/179493113608.1129989.9179084531222922608@gmail.com

Regards,
Manu

Attachment Content-Type Size
perfil-m.txt text/plain 515 bytes
perfil-fk.txt text/plain 515 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hüseyin Demir 2026-12-05 05:15:15 Re: Should we add timing output to pg_upgrade?
Previous Message shihao zhong 2026-12-05 04:59:57 Re: pg_rewind reports "no rewind required" due to stale minRecoveryPoint