pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: EXPLAIN and FK references?
Date: Thu, 12 Jan 2023 01:07:26 -0500
Message-ID: <899474.1673503646@sss.pgh.pa.us> (raw)
In-Reply-To: <269a6794-aa20-283d-bbc4-8cddaa2038de@gmail.com>
References: <269a6794-aa20-283d-bbc4-8cddaa2038de@gmail.com>

Ron <ronljohnsonjr@gmail.com> writes:
> Deletes are slow in one table with many indices and FK references. That's 
> not surprising, but it's *VERY* slow, and I'm trying to figure out why.

> Is there any EXPLAIN option which shows what "query plans" Pg is using when 
> checking FK references (index scan, seq scan, etc) during deletes (and 
> inserts and updates)?

No, not directly, but you could look at EXPLAIN ANALYZE to see which
of the RI triggers is eating the time.  It's not going to be hard to
figure out which one(s) are using indexed plans and which are not.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <899474.1673503646@sss.pgh.pa.us>
Permalink:  ../899474.1673503646@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/899474.1673503646@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, ronljohnsonjr@gmail.com
  Subject: Re: EXPLAIN and FK references?
  In-Reply-To: <899474.1673503646@sss.pgh.pa.us>
  References: <269a6794-aa20-283d-bbc4-8cddaa2038de@gmail.com> <899474.1673503646@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