Re: EXPLAIN: showing ReadStream / prefetch stats - Mailing list pgsql-hackers

From Andres Freund
Subject Re: EXPLAIN: showing ReadStream / prefetch stats
Date
Msg-id sr5bcs5g73675iqxqc7g62yud6jplcyayzdeumh6ne5qvk64iu@gct7k5v2upnb
Whole thread
In response to Re: EXPLAIN: showing ReadStream / prefetch stats  (Lukas Fittl <lukas@fittl.com>)
List pgsql-hackers
Hi,

On 2026-04-07 01:00:28 -0700, Lukas Fittl wrote:
> Btw, in that same test, when I re-run I get Prefetch but not I/O -- why is that?
> 
>  Seq Scan on organizations  (cost=0.00..7.42 rows=1 width=483) (actual
> time=0.034..0.042 rows=1.00 loops=1)
>    Filter: (slug = 'pganalyze'::text)
>    Rows Removed by Filter: 113
>    Prefetch: avg=1.00 max=1 capacity=94
>    Buffers: shared hit=6
> 
> (if its all buffers hit, why are there any prefetches at all?)

It's not really prefetching, which is visible as the distance being 1.  The
read stream is created at the start of the scan, not at the first miss.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Add errdetail() with PID and UID about source of termination signal
Next
From: Melanie Plageman
Date:
Subject: Re: EXPLAIN: showing ReadStream / prefetch stats