pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ping Yao <ping@optigo.net>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Help understand why DELETE is so slow
Date: Mon, 04 Dec 2023 19:43:07 -0500
Message-ID: <823512.1701736987@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEBRQisA2Ka+nLjVKR0_7MuEX4YcO32u+SUdchS1kF5z+HhpAg@mail.gmail.com>
References: <CAEBRQitRxHA-1D30FOm9XYoofcTncSnAuXho2ijxAa9E8+bJbQ@mail.gmail.com>
	<CAHyXU0yzTjJ1oZknujB5BwRp-gAbXYCpuMcO40PVWVyX1_LkUg@mail.gmail.com>
	<CAEBRQisA2Ka+nLjVKR0_7MuEX4YcO32u+SUdchS1kF5z+HhpAg@mail.gmail.com>

Ping Yao <ping@optigo.net> writes:
> Thank you for the comment. I think we do. What I found odd here is the
> Query Plan (with analyze) clearly shows the actual execution to be very
> quick, that's why I don't think it's an index problem. What do you think?

I wouldn't rule it out on that basis.  Foreign key enforcement is done
by AFTER triggers, which are not part of the query plan.  Having said
that, all modern versions of PG show trigger runtime as a separate
EXPLAIN output line, so slow FK checks aren't that hard to diagnose.
I agree with the other comments that this is likely a Citus-specific
issue, and that you came to the wrong place for expertise on that.

			regards, tom lane





view thread (6+ messages)

Message-ID: <823512.1701736987@sss.pgh.pa.us>
Permalink:  ../823512.1701736987@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/823512.1701736987@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ping@optigo.net, mmoncure@gmail.com
  Subject: Re: Help understand why DELETE is so slow
  In-Reply-To: <823512.1701736987@sss.pgh.pa.us>
  References: <CAEBRQitRxHA-1D30FOm9XYoofcTncSnAuXho2ijxAa9E8+bJbQ@mail.gmail.com> <CAHyXU0yzTjJ1oZknujB5BwRp-gAbXYCpuMcO40PVWVyX1_LkUg@mail.gmail.com> <CAEBRQisA2Ka+nLjVKR0_7MuEX4YcO32u+SUdchS1kF5z+HhpAg@mail.gmail.com> <823512.1701736987@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