public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ilia Evdokimov <[email protected]>
To: [email protected]
To: Tom Lane <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Marcos Pegoraro <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: V18 change on EXPLAIN ANALYZE
Date: Thu, 30 Oct 2025 17:35:24 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOtHd0Ame_kKndkjBzKPpCFoy6x3HoYrf0DeAoufT0ykNuDPEg@mail.gmail.com>
References: <CAB-JLwYCgdiB=trauAV1HN5rAWQdvDGgaaY_mqziN88pBTvqqg@mail.gmail.com>
	<CAOtHd0BJpzox6iW3Lm3Rcut8edeR+4xfW-7M_gWMRdkhp0oRxw@mail.gmail.com>
	<[email protected]>
	<CAOtHd0Ame_kKndkjBzKPpCFoy6x3HoYrf0DeAoufT0ykNuDPEg@mail.gmail.com>

Hi hackers,

On 27.09.2025 03:31, Maciek Sakrejda wrote:
> However, to get a parallel query in the regression database (I chose
> EXPLAIN ANALYZE SELECT * FROM tenk2), I had to change some settings:
>
> SET min_parallel_table_scan_size = 0;
> SET parallel_tuple_cost = 0;
> SET parallel_setup_cost = 0;
>
> Should I mention that in the example? Or should I generate a bigger
> table so using these is not necessary? If we say nothing and use the
> example, I think it may be confusing if someone wants to use the
> example as a starting point for their own exploration of how this
> works. Or is there a better query that works out of the box and does
> not need changes to the settings?
>
> It also seems like the EXPLAIN ANALYZE section is getting a little
> unwieldy. Should we subdivide it, or is this still okay?


Thanks for noticing the documentation gap regarding parallel plans.

1. I think the mention of VERBOSE might be unnecessary, since this is 
already covered in parallel.sgml, section 'Parallel Plan Tips'. That 
section explicitly says that EXPLAIN (ANALYZE, VERBOSE) shows per-worker 
statistics.

2. Instead of introducing another query, why not reuse the one already 
shown earlier in the same section, just with the GUCs adjusted to make 
it parallel? For example:

SET min_parallel_table_scan_size = 0;
SET parallel_tuple_cost = 0;
SET parallel_setup_cost = 0;

EXPLAIN ANALYZE
SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
  Gather  (cost=4.65..70.96 rows=10 width=488) (actual time=1.670..6.246 
rows=10.00 loops=1)
    Workers Planned: 2
    Workers Launched: 2
    Buffers: shared hit=78 read=6
    ->  Nested Loop  (cost=4.65..70.96 rows=4 width=488) (actual 
time=0.218..0.277 rows=3.33 loops=3)
          Buffers: shared hit=78 read=6
          ->  Parallel Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.31 
rows=4 width=244) (actual time=0.195..0.202 rows=3.33 loops=3)
                Recheck Cond: (unique1 < 10)
                Heap Blocks: exact=10
                Buffers: shared hit=54
                ->  Bitmap Index Scan on tenk1_unique1 (cost=0.00..4.36 
rows=10 width=0) (actual time=0.449..0.450 rows=10.00 loops=1)
                      Index Cond: (unique1 < 10)
                      Index Searches: 1
                      Buffers: shared hit=2
          ->  Index Scan using tenk2_unique2 on tenk2 t2 
(cost=0.29..7.90 rows=1 width=244) (actual time=0.020..0.020 rows=1.00 
loops=10)
                Index Cond: (unique2 = t1.unique2)
                Index Searches: 10
                Buffers: shared hit=24 read=6
  Planning:
    Buffers: shared hit=141 read=3
  Planning Time: 0.519 ms
  Execution Time: 6.302 ms
(22 rows)

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/


view thread (11+ messages)  latest in thread

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], [email protected], [email protected]
  Subject: Re: V18 change on EXPLAIN ANALYZE
  In-Reply-To: <[email protected]>

* 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