Re: Table order at FROM clause affects performance?

From: Eduard Català <eduard(dot)catala(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Table order at FROM clause affects performance?
Date: 2018-04-12 16:25:07
Message-ID: CAL54xNYNH76HB1bL_WMOSXd=8L=MF854M_5gtDB1Y-+W-FYwQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yes... i can't exepct useful help with my poor explanation
but your aproach is the right answer!

We were limited with from_collapse_limit.

Cost now is: 112

Many many thanks.

On Thu, Apr 12, 2018 at 5:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> =?UTF-8?Q?Eduard_Catal=C3=A0?= <eduard(dot)catala(at)gmail(dot)com> writes:
> > Given this statement:
>
> > SELECT *several_fields* FROM A, B, C WHERE *conditions*
> > A, B are tables with several LEFT JOINS but they act as one subquery.
>
> You really can't expect useful help if you are going to pose questions
> that abstract. You have removed details that count, and made assumptions
> that don't necessarily hold (e.g., what does "act as one subquery" mean?)
>
> Probably the most likely bet, on this limited information, is that there
> are enough base tables hidden inside your query that you're running into
> join_collapse_limit and/or from_collapse_limit, resulting in the planner
> failing to investigate the best available plan in one case. Raising those
> limits would help, if so. But it could easily be something else.
>
> There's some suggestions here about how to ask useful questions:
>
> https://wiki.postgresql.org/wiki/Slow_Query_Questions
>
> regards, tom lane
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ants Aasma 2018-04-13 09:55:03 Re: Latest advice on SSD?
Previous Message Tom Lane 2018-04-12 15:30:28 Re: Table order at FROM clause affects performance?