Re: Tables used in query not listed in EXPLAIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Melo <al_nunes(at)atua(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tables used in query not listed in EXPLAIN
Date: 2014-10-16 20:04:28
Message-ID: 8909.1413489868@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Melo <al_nunes(at)atua(dot)com(dot)br> writes:
> I have a peculiar situation here. I'm optimizing some queries and I
> noticed that EXPLAIN doesn't always show the tables involved in the
> query. Below is a little example, but I have other examples with longer
> queries. Note that the tables tabela_documento_fiscal and pessoa aren't
> considered on it's output. Am I missing someting or it might be a bug?

It looks to me like it's optimizing away the left joins, presumably
on the grounds that they join to a unique key so there can't be more
than one matching row --- and this query has no need to know exactly
which row, if any, matches.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Emi Lu 2014-10-16 20:04:37 CopyManager(In/out) vs. delete/insert directly
Previous Message Alvaro Melo 2014-10-16 19:52:22 Tables used in query not listed in EXPLAIN