Re: Incomplete Explain for delete

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Incomplete Explain for delete
Дата
Msg-id 4794.1434989988@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Incomplete Explain for delete  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Incomplete Explain for delete  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Jun 22, 2015 at 11:47 AM, Ghislain ROUVIGNAC <ghr@sylob.com> wrote:
>> So I think explain needs an improvement as it does not show the real plan
>> used when running the query.

> The underlying limitation here is that the planner does not concern itself
> with triggers.

> ​There is definitely room for improvement here but this complaint by itself
> is not particularly influential to me.​  The black-box nature of functions
> makes anything more detailed than "this table has triggers" difficult -
> though maybe FK check triggers could be special-cased.

Well, even if EXPLAIN special-cased FK triggers, it would have a hard time
seeing the plan used for the queries done inside the triggers.

It is true that if you run EXPLAIN ANALYZE, it will show you the amount of
time spent in each trigger, which at least is enough to point the finger
in the right direction.  I realize that's not much help if the query takes
so long that you can't EXPLAIN ANALYZE it :-(.

I don't remember at the moment whether contrib/auto_explain is capable of
capturing FK-trigger-fired queries, but if it is, that might be a possible
avenue to seeing what's happening.

            regards, tom lane

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Incomplete Explain for delete
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Incomplete Explain for delete