pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stelian Iancu <stelian@iancu.ch>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query (wrong index used maybe)
Date: Mon, 27 Jan 2014 10:06:24 -0500
Message-ID: <2631.1390835184@sss.pgh.pa.us> (raw)
In-Reply-To: <1390833860.7369.75825537.0CAF7BA8@webmail.messagingengine.com>
References: <1390833860.7369.75825537.0CAF7BA8@webmail.messagingengine.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Stelian Iancu <stelian@iancu.ch> writes:
> I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a
> fairly large database (some tables with approx. 1 mil. records) and I
> have the following query:
> [ 13-way join joined to a 3-way join ]

Think you'll need to raise join_collapse_limit and from_collapse_limit
to get the best plan here.  The planning time might hurt, though.

TBH that schema looks designed for inefficiency; you'd be better off
rethinking the design rather than hoping the planner is smart enough
to save you from it.

			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 (9+ messages)  latest in thread

Message-ID: <2631.1390835184@sss.pgh.pa.us>
Permalink:  ../2631.1390835184@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2631.1390835184@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, stelian@iancu.ch
  Subject: Re: Slow query (wrong index used maybe)
  In-Reply-To: <2631.1390835184@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