pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: msc@antzsystem.de
Cc: pgsql-performance@postgresql.org
Subject: Re: problem with from_collapse_limit and joined views
Date: Sat, 04 Dec 2010 11:59:58 -0500
Message-ID: <24137.1291481998@sss.pgh.pa.us> (raw)
In-Reply-To: <4CFA09E2020000250003829C@gw.wicourts.gov>
References: <4CFA09E2020000250003829C@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Markus Schulz  11/24/10 1:02 PM >>>
>> if i set "from_collapse_limit" (to merge the views) and
>> join_collapse_limit (to explode the explicit joins) high enough
>> (approx 32), all is fine (good performance). But other queries are
>> really slow in our environment (therefore it's no option to raise
>> the join_collapse_limit to a higher value)
>> 
>> With defaults (8) for both, the performance is ugly
 
> One option would be to create a different user for running queries
> which read from complex views such as this.  

If you don't want to change the collapse limits, the only other option
is to restructure this specific query so that its syntactic structure
is closer to the ideal join order.  Look at the plan you get in the
good-performing case and re-order the join syntax to look like that.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <24137.1291481998@sss.pgh.pa.us>
Permalink:  ../24137.1291481998@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24137.1291481998@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, Kevin.Grittner@wicourts.gov, msc@antzsystem.de
  Subject: Re: problem with from_collapse_limit and joined views
  In-Reply-To: <24137.1291481998@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