pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Titus von Boxberg <titus@elbe-informatik.de>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: strange and slow joining of nested views
Date: Sat, 04 Feb 2017 00:16:21 -0500
Message-ID: <20264.1486185381@sss.pgh.pa.us> (raw)
In-Reply-To: <e94d7a48bb564ed69feb0affec2d71a4@SOLOWJOW.ELBE.local>
References: <e94d7a48bb564ed69feb0affec2d71a4@SOLOWJOW.ELBE.local>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Titus von Boxberg <titus@elbe-informatik.de> writes:
> I got the following problem for which I could not find a solution by searching the archives:
> I have Tables Ta, Tb, Tc with primary keys as bigserials.
> Ta references Tb references Tc.
> Not all but most rows in Ta reference exactly one row in Tb.

Hm, your problem query has 11 table scans (not to mention a couple of
subplans) so you're oversimplifying here.  Anyway, I think that increasing
join_collapse_limit and/or from_collapse_limit to at least 11 might help.
As-is, you're more or less at the mercy of whether your textual query
structure corresponds to a good join order.

			regards, tom lane


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



view thread (3+ messages)  latest in thread

Message-ID: <20264.1486185381@sss.pgh.pa.us>
Permalink:  ../20264.1486185381@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20264.1486185381@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, titus@elbe-informatik.de
  Subject: Re: strange and slow joining of nested views
  In-Reply-To: <20264.1486185381@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