Re: Plans for ON DELETE CASCADE? Which index is used, if at all? - Mailing list pgsql-general

From Tom Lane
Subject Re: Plans for ON DELETE CASCADE? Which index is used, if at all?
Date
Msg-id 3463921.1680009811@sss.pgh.pa.us
Whole thread Raw
In response to Plans for ON DELETE CASCADE? Which index is used, if at all?  (Dominique Devienne <ddevienne@gmail.com>)
Responses Re: Plans for ON DELETE CASCADE? Which index is used, if at all?  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Cluster table based on grand parent?
Next
From: Julius de Bruijn
Date:
Subject: How are the SELECT queries reconstructed in pg_views