Re: [PATCH] Include triggers in EXPLAIN

From: Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pavel(dot)stehule(at)gmail(dot)com, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: [PATCH] Include triggers in EXPLAIN
Date: 2019-11-04 09:35:25
Message-ID: CAFp7QwrJqG4oF5-9H-=8J9PkGwGnHV70xLi19jLMExA97qVfnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Tom.

Thanks for quick response. As I was testing this feature it shows all
"possible" triggers to be executed running given query. The benefit of
having this information in EXPLAIN as well is you do not need to execute
the query (as EXPLAIN ANALYZE does). My usecase is to take a look at query
before it is executed to get some idea about the plan with EXPLAIN.

Do you have idea about some case where actual trigger will be missing in
EXPLAIN with current implementation, but will be present in EXPLAIN
ANALYZE? I can take a look if there's any way how to handle those cases as
well.

ne 3. 11. 2019 v 22:49 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= <josef(dot)simanek(at)gmail(dot)com> writes:
> > Recently I got few times into situation where I was trying to find out
> what
> > is blocking DELETE queries. Running EXPLAIN (even VERBOSE one) wasn't
> > useful, since the reason was slow trigger (missing index on foreign key
> > column). I had to create testing entry and run EXPLAIN ANALYZE DELETE to
> > get this information.
>
> > It will be really valuable for me to show triggers in EXPLAIN query since
> > it will make clear for me there will be any trigger "activated" during
> > execution of DELETE query and that can be the reason for slow DELETE.
>
> I don't really see the point of this patch? You do get the trigger
> times during EXPLAIN ANALYZE, and I don't believe that a plain EXPLAIN
> is going to have full information about what triggers might fire or
> not fire.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-11-04 10:02:33 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Kuntal Ghosh 2019-11-04 09:13:38 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions