pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter <pmc@citylink.dinoex.sub.org>
To: pgsql-performance@lists.postgresql.org
Subject: Re: Should from_collapse be switched off? (queries 10 times faster)
Date: Fri, 23 Mar 2018 15:30:52 +0100
Message-ID: <20180323143052.GA30371@gate.oper.dinoex.org> (raw)
In-Reply-To: <1521805295.2471.40.camel@cybertec.at>
References: <20180323100308.GA1188@gate.oper.dinoex.org>
	<1521805295.2471.40.camel@cybertec.at>

On Fri, Mar 23, 2018 at 12:41:35PM +0100, Laurenz Albe wrote:

! https://www.postgresql.org/docs/current/static/explicit-joins.html
! states towards the end of the page that the search tree grows
! exponentially with the number of relations, and from_collapse_limit
! can be set to control that.

Yes, I read that page.

! > In my case, planning uses 1 or 2% of the cycles needed for
! > execution; that seems alright to me. 
! > And, as said above, I cannot see why my queries might be an
! > atypical case (I don't think they are).
! > 
! > If somebody would like to get a hands-on look onto the actual
! > case, I'd be happy to put it online.
! 
! It seems like you are barking up the wrong tree.
! 
! Your query does not take long because of the many relations in the
! FROM list, but because the optimizer makes a wrong choice.

Exactly! 
And I am working hard in order to understand WHY this happens.

! The correct solution is *not* to set from_collapse_limit = 1, but
! to find and fix the problem that causes the optimizer to make a
! wrong choice.
! 
! If you send the query and the output of
! EXPLAIN (ANALYZE, BUFFERS) SELECT ...
! we have a chance of telling you what's wrong.

Your viewpoint would be preferrable, only I am lacking any idea on
where there could be such a problem that would make up a root cause.

I will gladly follow Your suggestion; data is underway. 

P.




view thread (10+ messages)  latest in thread

Message-ID: <20180323143052.GA30371@gate.oper.dinoex.org>
Permalink:  ../20180323143052.GA30371@gate.oper.dinoex.org/
Also on:    postgresql.org/message-id/20180323143052.GA30371@gate.oper.dinoex.org

 · 

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: pmc@citylink.dinoex.sub.org, pgsql-performance@lists.postgresql.org
  Subject: Re: Should from_collapse be switched off? (queries 10 times faster)
  In-Reply-To: <20180323143052.GA30371@gate.oper.dinoex.org>

* 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