Re: Strange "actual time" in simple CTE

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jean-Christophe Boggio <postgresql(at)thefreecat(dot)org>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Strange "actual time" in simple CTE
Date: 2023-12-04 03:15:27
Message-ID: CAMkU=1zLViLfA=gBdK-+h94TwHLVdqgEWTADkVQ4c5WQEfX=Aw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, Dec 2, 2023 at 11:50 AM Jean-Christophe Boggio <
postgresql(at)thefreecat(dot)org> wrote:

> Hello,
>
> I am trying to optimize a complex query and while doing some explains, I
> stumbled upon this :
>
> CTE cfg
> -> Result (cost=2.02..2.03 rows=1 width=25) (actual
> time=7167.478..7167.481 rows=1 loops=1)
> ...
> How can this take 7 seconds?
>

> This really looks like an artefact (maybe in relation to the JIT compiler?)
>
>
Exactly. The time taking to do the JIT compilations gets measured in
non-intuitive places in the plan. I'm guessing that that is what is going
on here, especially since the time separately reported at the end of the
plan for JIT so closely matches this mysterious time. Just turn JIT off, I
doubt it doing you any good anyway.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jerry Brenner 2023-12-04 14:45:39 Does Postgres have consistent identifiers (plan hash value) for explain plans?
Previous Message Jean-Christophe Boggio 2023-12-02 16:50:02 Strange "actual time" in simple CTE