From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: alexfilus@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16136: Bug with cost calculation and JIT application
Date: Mon, 25 Nov 2019 14:27:15 +0100
Message-ID: <20191125132715.qrbeytjrmhinba7m@development> (raw)
In-Reply-To: <16136-34535de58a0ff493@postgresql.org>
References: <16136-34535de58a0ff493@postgresql.org>
On Mon, Nov 25, 2019 at 01:00:34PM +0000, PG Bug reporting form wrote:
>The following bug has been logged on the website:
>
>Bug reference: 16136
>Logged by: Александр Филиппенко
>Email address: alexfilus@gmail.com
>PostgreSQL version: 12.1
>Operating system: Ubuntu 18.04
>Description:
>
>I had very strange behaviour of optimizator.
>https://explain.depesz.com/s/GcHL
>https://explain.depesz.com/s/sTyG
>Both explains are for same query and same data set, but in second case I
>turn off JIT. I guess it's because of wrong cost calculation like this
>Nested Loop (cost=463.86..5575122.76 rows=652 width=74) (actual
>time=9.685..67.713 rows=18 loops=1)
>
Not sure what exactly you mean by "wrong cost calculation"?
The reason for the long duration with JIT seems pretty clear:
Functions: 237
Options: Inlining true, Optimization true, Expressions true, Deforming true
Timing: Generation 45.190 ms, Inlining 37.452 ms, Optimization 1292.680 ms, Emission 1076.752 ms, Total 2452.074 ms
That is, it took about 2.3s to optimize and emit the JIT code, most
likely because due to a fairly high number of functions. I'm not sure
that's something we can really fix, but there were discussions about
being smarter about optimizations etc.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, alexfilus@gmail.com
Subject: Re: BUG #16136: Bug with cost calculation and JIT application
In-Reply-To: <20191125132715.qrbeytjrmhinba7m@development>
References: <16136-34535de58a0ff493@postgresql.org> <20191125132715.qrbeytjrmhinba7m@development>
* 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