From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Marco Di Cesare <Marco.DiCesare@pointclickcare.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Query with large number of joins
Date: Tue, 21 Oct 2014 12:46:46 -0400
Message-ID: <6038.1413910006@sss.pgh.pa.us> (raw)
In-Reply-To: <54468A4A.8090908@dunslane.net>
References: <e187bede699941a4b3fe6781a69ecd14@CO2PR0701MB759.namprd07.prod.outlook.com>
<CAHyXU0y+YqCgizzQicqpaN6surof4DnR6xjTXaunuw5_yjDZJw@mail.gmail.com>
<0a72826fe7d04b71b9ab47d24992d898@CO2PR0701MB759.namprd07.prod.outlook.com>
<54468A4A.8090908@dunslane.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Andrew Dunstan <andrew@dunslane.net> writes:
> Have you tried a) either turning off geqo or setting geqo_threshold
> fairly high b) setting join_collapse_limit fairly high (assuming all the
> above join targets are tables and not views, setting it to something
> like 25 should do the trick.
You'd have to do both, I think, to get an exhaustive plan search.
In any case, this query is going to result in full table scans of most
of the tables, because there just aren't very many WHERE constraints;
so expecting it to run instantaneously is a pipe dream. I'm not sure
that there's a significantly better plan to be had.
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
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, andrew@dunslane.net, Marco.DiCesare@pointclickcare.com, mmoncure@gmail.com
Subject: Re: Query with large number of joins
In-Reply-To: <6038.1413910006@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