Re: Incomplete Explain for delete - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Incomplete Explain for delete
Date
Msg-id CAKFQuwY_RYXJJJtTvRvCxfvOgT-z5_n2h+wPDLFwa7VQvZpsOg@mail.gmail.com
Whole thread Raw
In response to Incomplete Explain for delete  (Ghislain ROUVIGNAC <ghr@sylob.com>)
Responses Re: Incomplete Explain for delete  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.
>
> Instead of displaying:
> Delete on uniform (cost=3D0.000..4,489.270 rows=3D57,847 width=3D6)
> -> Index Scan using two on uniform (cost=3D0.000..4,489.270 rows=3D57,847
> width=3D6)
> Index Cond: ((bravo)::text =3D 'romeo'::text)
>
It should display something like this
> Delete on uniform (cost=3D0.000..4,489.270 rows=3D57,847 width=3D6)
> -> Index Scan using two on uniform (cost=3D0.000..4,489.270 rows=3D57,847
> width=3D6)
> Index Cond: ((bravo)::text =3D 'romeo'::text)
> -> Foreign Keys check
> -> Index Scan using ix_ref1 on referencing1 (cost=3D rows=3D width=3D)
>  Index Cond: ...
> -> ...
>  -> Index Scan using ix_refN on referencingN (cost=3D rows=3D width=3D)
>  Index Cond: ...
>
>
The underlying limitation here is that the planner does not concern itself
with triggers.

=E2=80=8BThere is definitely room for improvement here but this complaint b=
y itself
is not particularly influential to me.=E2=80=8B  The black-box nature of fu=
nctions
makes anything more detailed than "this table has triggers" difficult -
though maybe FK check triggers could be special-cased.

David J.

pgsql-bugs by date:

Previous
From: Ghislain ROUVIGNAC
Date:
Subject: Incomplete Explain for delete
Next
From: Tom Lane
Date:
Subject: Re: Incomplete Explain for delete