pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Jacque Edmund <jacqueedmund@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Native Foreign Keys housekeeping time intensive for Relational Model
Date: Sat, 27 Mar 2021 10:43:21 -0400
Message-ID: <2002503.1616856201@sss.pgh.pa.us> (raw)
In-Reply-To: <fb45b9f1134ad17b944eb073ac8523f37f4199a9.camel@cybertec.at>
References: <CANOmo02GKKLsGbszLtAzLLX--Ab6d-9Bp51bYDC3dfRhe8dgvA@mail.gmail.com>
	<fb45b9f1134ad17b944eb073ac8523f37f4199a9.camel@cybertec.at>

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Fri, 2021-03-26 at 14:00 -0400, Jacque Edmund wrote:
>> I've already seen that my current set of FK relationships between < 100 tables and data footprint
>> has yielded very large lookup times for the underlying referential integrity of the FKs to vet
>> whether it can DELETE a row or not based on its FK relationships.

> I would be surprised if correctly indexed foreign keys would slow deletes down so that
> the performance becomes intolerable.

Deletes being slow often means that you don't have an index on the
referencing column(s).  PG requires you to have an index on the referenced
columns, but not on the other side of the FK relationship.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <2002503.1616856201@sss.pgh.pa.us>
Permalink:  ../2002503.1616856201@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2002503.1616856201@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, jacqueedmund@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Native Foreign Keys housekeeping time intensive for Relational Model
  In-Reply-To: <2002503.1616856201@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox