Re: Strange "actual time" in simple CTE - Mailing list pgsql-performance

From Jeff Janes
Subject Re: Strange "actual time" in simple CTE
Date
Msg-id CAMkU=1zLViLfA=gBdK-+h94TwHLVdqgEWTADkVQ4c5WQEfX=Aw@mail.gmail.com
Whole thread Raw
In response to Strange "actual time" in simple CTE  (Jean-Christophe Boggio <postgresql@thefreecat.org>)
List pgsql-performance


On Sat, Dec 2, 2023 at 11:50 AM Jean-Christophe Boggio <postgresql@thefreecat.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

pgsql-performance by date:

Previous
From: Jean-Christophe Boggio
Date:
Subject: Strange "actual time" in simple CTE
Next
From: Jerry Brenner
Date:
Subject: Does Postgres have consistent identifiers (plan hash value) for explain plans?