Re: strange and slow joining of nested views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Titus von Boxberg <titus(at)elbe-informatik(dot)de>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: strange and slow joining of nested views
Date: 2017-02-04 05:16:21
Message-ID: 20264.1486185381@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Titus von Boxberg <titus(at)elbe-informatik(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vucomir Ianculov 2017-02-04 16:45:08 Re: pgsql connection timeone
Previous Message Titus von Boxberg 2017-02-03 21:23:49 strange and slow joining of nested views