public inbox for pgsql-performance@postgresql.org
help / color / mirror / Atom feedFrom: Pavel Stehule <pavel.stehule@gmail.com>
To: Gunther <raj@gusw.net>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: query performance issue
Date: Wed, 15 Nov 2017 21:07:01 +0100
Message-ID: <CAFj8pRDxs5i5TP9Katti=dZFo80eRZX2TyoHLABgmxYwYEt6xA@mail.gmail.com> (raw)
In-Reply-To: <31c10833-9d19-dfa5-1cab-43eaae097828@gusw.net>
References: <CAA=to3gXpr94TqSAYXT9zwxYwY_xKrLFnu8ZJNgJKP-kWza2CA@mail.gmail.com>
<CAFj8pRCyvCktcxtEQrmF4kw5oR1DNYd_4gJNd6mkjrHw_NPPPw@mail.gmail.com>
<CAA=to3gnNReZ62m3K3qbN_KL8Hnmrg4wfb4LefZYqUa9v4OOSQ@mail.gmail.com>
<CAFj8pRC6xh=HDq1jwxW8n1Ct8=FbbdqHcx_VFHNCdNUz41rTWQ@mail.gmail.com>
<31c10833-9d19-dfa5-1cab-43eaae097828@gusw.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
2017-11-15 20:58 GMT+01:00 Gunther <raj@gusw.net>:
>
> On 11/15/2017 8:12, Pavel Stehule wrote:
>
> There is wrong plan due wrong estimation
>
> for this query you should to penalize nested loop
>
> set enable_nestloop to off;
>
> before evaluation of this query
>
>
> You are not the only one with this issue. May I suggest to look at this
> thread a little earlier this month.
>
> http://www.postgresql-archive.org/OLAP-reporting-queries-
> fall-into-nested-loops-over-seq-scans-or-other-horrible-
> planner-choices-tp5990160.html
>
> where this has been discussed in some length.
>
It is typical issue. The source of these problems are correlations between
columns (it can be fixed partially by multicolumn statistics in PostgreSQL
10). Another problem is missing multi table statistics - PostgreSQL planner
expects so any value from dictionary has same probability, what is not
usually true. Some OLAP techniques like calendar tables has usually very
bad impact on estimations with this results.
Regards
Pavel
> regards,
> -Gunther
>
>
>
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: pavel.stehule@gmail.com, raj@gusw.net
Subject: Re: query performance issue
In-Reply-To: <CAFj8pRDxs5i5TP9Katti=dZFo80eRZX2TyoHLABgmxYwYEt6xA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox