Re: Joining 16 tables seems slow

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Frank Millman <frank(at)chagford(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Joining 16 tables seems slow
Date: 2017-09-12 14:05:35
Message-ID: CAFj8pRDirLEjKjgEjv-0iCqxyJwtjOX8CCEaWaiyOR4S8BSx3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2017-09-12 14:01 GMT+02:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> "Frank Millman" <frank(at)chagford(dot)com> writes:
> > Pavel Stehule wrote:
> >> 2017-09-12 8:45 GMT+02:00 Frank Millman <frank(at)chagford(dot)com>:
> >>> I am experimenting with optimising a SQL statement. One version uses
> 4 LEFT JOIN’s and a 5-way CASE statement in the body. The second moves the
> filtering into the JOIN section, and I end up with 16 LEFT JOIN’s and no
> CASE statements.
>
> >> you can experimentally try increase FROM_COLLAPSE_LIMIT to some higher
> number 14 maybe 16
>
> > I tried increasing FROM_COLLAPSE_LIMIT, but it made no difference.
>
> For this you need to increase join_collapse_limit, not
> from_collapse_limit. (Usually, though, there's little reason not to keep
> them the same.)
>

sure - my mistake - I though it.

Thank you

Pavel

>
> regards, tom lane
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2017-09-12 14:43:51 Re: WAL & ready files retained after turning off log shipping
Previous Message Chris Travers 2017-09-12 13:36:21 Re: Joining 16 tables seems slow