public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: Pecsök Ján <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Reading execution plan - first row time vs last row time
Date: Tue, 1 Oct 2024 10:39:11 -0400
Message-ID: <CAKAnmmJ6wyM2egwebC_R_=H-0SGP7QPzOKepz_=2c=1x9ekiYA@mail.gmail.com> (raw)
In-Reply-To: <AS1PR05MB91059DA7056B7C30EAE61AA59F772@AS1PR05MB9105.eurprd05.prod.outlook.com>
References: <AS1PR05MB91059DA7056B7C30EAE61AA59F772@AS1PR05MB9105.eurprd05.prod.outlook.com>

On Tue, Oct 1, 2024 at 9:53 AM Pecsök Ján <[email protected]> wrote:

> We see significant difference in explain analyze Actual time in the first
> line of execution plan and Execution time in the last line of execution
> plan. What can be the reason?
>
>
>
> For example, first line of execution plan:
>
> Gather  (cost=1038.49..257627100.42 rows=7943222226 width=104) (actual
> time=531.925..3673159.806 rows=7943221053 loops=1)
>

It takes an hour for Postgres to gather up 7.9 BILLION (!) rows, but then
it is going to take additional time to do something with all of those rows.
That's where the rest of your time is going. Seeing your actual query would
be a help. If this is a CTAS (Create Table As Select), then you have an
hour for the 'Select' part, and the rest of your time is in the 'Create
Table' part.

Cheers,
Greg


view thread (3+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Reading execution plan - first row time vs last row time
  In-Reply-To: <CAKAnmmJ6wyM2egwebC_R_=H-0SGP7QPzOKepz_=2c=1x9ekiYA@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