pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Ghislain ROUVIGNAC <ghr@sylob.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Incomplete Explain for delete
Date: Mon, 22 Jun 2015 12:19:48 -0400
Message-ID: <4794.1434989988@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwY_RYXJJJtTvRvCxfvOgT-z5_n2h+wPDLFwa7VQvZpsOg@mail.gmail.com>
References: <CAH12p1DdCst11O9Adivjd9LJ2v5nr0448vLofja04ioO1BQvKA@mail.gmail.com>
	<CAKFQuwY_RYXJJJtTvRvCxfvOgT-z5_n2h+wPDLFwa7VQvZpsOg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <4794.1434989988@sss.pgh.pa.us>
Permalink:  ../4794.1434989988@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4794.1434989988@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, ghr@sylob.com
  Subject: Re: Incomplete Explain for delete
  In-Reply-To: <4794.1434989988@sss.pgh.pa.us>
  References: <CAH12p1DdCst11O9Adivjd9LJ2v5nr0448vLofja04ioO1BQvKA@mail.gmail.com> <CAKFQuwY_RYXJJJtTvRvCxfvOgT-z5_n2h+wPDLFwa7VQvZpsOg@mail.gmail.com> <4794.1434989988@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox