Re: Plans for ON DELETE CASCADE? Which index is used, if at all?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Plans for ON DELETE CASCADE? Which index is used, if at all?
Date: 2023-03-28 13:23:31
Message-ID: 3463921.1680009811@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne <ddevienne(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julius de Bruijn 2023-03-28 13:43:07 How are the SELECT queries reconstructed in pg_views
Previous Message Dominique Devienne 2023-03-28 13:17:36 Cluster table based on grand parent?