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

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: Plans for ON DELETE CASCADE? Which index is used, if at all?
Дата
Msg-id CAFCRh-9N6mf0CBOPmJHz1FZMo=EhjQN1OhsvE2NT5rOVtfKiWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Plans for ON DELETE CASCADE? Which index is used, if at all?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Plans for ON DELETE CASCADE? Which index is used, if at all?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Tue, Mar 28, 2023 at 3:23 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
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.

Thanks. Looks like this won't be easily available to me :(. --DD

dd=> select * from pg_available_extensions where name like '%auto%';
  name   | default_version | installed_version |                comment
---------+-----------------+-------------------+---------------------------------------
 autoinc | 1.0             |                   | functions for autoincrementing fields
(1 row)

dd=> select * from pg_available_extensions where name like '%explain%';
 name | default_version | installed_version | comment
------+-----------------+-------------------+---------
(0 rows) 

В списке pgsql-general по дате отправления:

Предыдущее
От: Julius de Bruijn
Дата:
Сообщение: How are the SELECT queries reconstructed in pg_views
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Plans for ON DELETE CASCADE? Which index is used, if at all?