From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Plans for ON DELETE CASCADE? Which index is used, if at all?
Date: Tue, 28 Mar 2023 09:23:31 -0400
Message-ID: <3463921.1680009811@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-9YVryrkLa8eEXPG91wOWyMty4K4oy9YYKA9Jny0BTfGA@mail.gmail.com>
References: <CAFCRh-9YVryrkLa8eEXPG91wOWyMty4K4oy9YYKA9Jny0BTfGA@mail.gmail.com>
Dominique Devienne <ddevienne@gmail.com> writes:
> Hi. Given the classical parent/child schema below, with an ON DELETE
> CASCADE FK constraint, I'd like to know which index is used (if any) to
> delete child rows affected by the CASCADE.
> But explain (analyze) does not give me that.
Yeah, it will just report the time spent in the FK triggers,
not what they were doing exactly.
IIRC, you can see the CASCADE operations with contrib/auto_explain,
if you enable auto_explain.log_nested_statements.
regards, tom lane
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, ddevienne@gmail.com
Subject: Re: Plans for ON DELETE CASCADE? Which index is used, if at all?
In-Reply-To: <3463921.1680009811@sss.pgh.pa.us>
References: <CAFCRh-9YVryrkLa8eEXPG91wOWyMty4K4oy9YYKA9Jny0BTfGA@mail.gmail.com> <3463921.1680009811@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