Subject: Re: Another documentation issue

From: Laurenz Albe <[email-masked]>
Date: Wed, 23 Apr 2025 09:16:23 +0200

On Wed, 2025-04-23 at 00:21 -0500, Igor Korot wrote:
> On the page https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-SEQ-PAGE-COST
> 
> it is only given the default value of this parameter.
> 
> No min/max values are provided..
> 
> The same can be sad about
> https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-RANDOM-PAGE-COST

Sad.  But you can interpret it as "there is no maximum".  The actual maximum is DBL_MAX,
the biggest double precision value that your system can handle, and may depend on your
architecture.

> However, this page
> https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY
> describes both default and mn/max, however t s says:
> 
> [quote]
> The default is 1 on supported systems, otherwise 0
> [/quote]]
> 
> No explanation of what is "supported system" is given...
> 
> And the same can be said about
> https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-IO-CONCURRENCY.

According to the source, it is "systems that have posix_fadvise()".  We could document that,
but I don't know if it would help many people.  I am not sure how easy and feasible it is
to research which versions of which operating systems qualify.

Yours,
Laurenz Albe

---

From: Daniel Gustafsson <[email-masked]>
Date: Wed, 23 Apr 2025 11:14:13 +0200

> On 23 Apr 2025, at 09:16, Laurenz Albe <[email-masked]> wrote:

> to research which versions of which operating systems qualify.

From memory it's supported on FreeBSD, NetBSD and Linux with Windows, macOS and
OpenBSD not supporting it.  Assuming I'm not completely wrong (a 1 minute
search shows it's in the ballpark) we could perhaps add something like
"Unsupported platforms include (but isn't limited to) Windows and macOS" which
would provide a bit more clarity.

--
Daniel Gustafsson

---

From: Tom Lane <[email-masked]>
Date: Wed, 23 Apr 2025 14:28:16 -0400

> would provide a bit more clarity.

If we do anything about this, I'd just say "systems that have
posix_fadvise()".  If we write something more specific it's likely to
become obsolete, and it doesn't seem to me that it's hard for someone
to research "does my box have posix_fadvise()?".

			regards, tom lane

---

From: Igor Korot <[email-masked]>
Date: Wed, 23 Apr 2025 13:32:50 -0500

Hi, Tom,

On Wed, Apr 23, 2025 at 1:28 PM Tom Lane <[email-masked]> wrote:

> to research "does my box have posix_fadvise()?

Imagine a person that wants to write a program which will cover creating
the table space.

Such person needs to cover the appropriate fields with possible values.

Is there a #define such person should check to cover the appropriate values?

Thank you?

".

---

From: Tom Lane <[email-masked]>
Date: Wed, 23 Apr 2025 14:40:54 -0400

> Is there a #define such person should check to cover the appropriate values?

HAVE_POSIX_FADVISE.  Seems to me it'd be way easier to find that
from documentation that mentions posix_fadvise than from documentation
that says "it works on systems X, Y, Z".

			regards, tom lane

---

From: Igor Korot <[email-masked]>
Date: Wed, 23 Apr 2025 15:15:08 -0500

Tom,

> that says "it works on systems X, Y, Z".

Agreed.
Hopefully someone can put this in…

Thx.

---

From: Igor Korot <[email-masked]>
Date: Thu, 24 Apr 2025 00:09:49 -0500

Tom,

> that says "it works on systems X, Y, Z".

Most of the time the client and server are located on different machines.
So there is no way to identify what server is supporting.

How do you handle sch situation from the client POV?

Thank you.

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 23 Apr 2025 22:23:39 -0700

> How do you handle sch situation from the client POV?

Get the current value.  If it’s non-zero the system definitely supports
it.  If it’s zero it probably doesn’t.  But give the user an option to
specify a value anyway just in case.  If they try and it errors, it doesn’t
support it.

David J.

---

From: Igor Korot <[email-masked]>
Date: Thu, 24 Apr 2025 00:26:47 -0500

Hi, Laurenz,

> the biggest double precision value that your system can handle, and may depend on your

So if I want to execute it from the client code (whether ODBC based or
libpq based),
how do I handle it?

Because most of the time client and server are located on different machines...

Thank you.

---

From: Peter Eisentraut <[email-masked]>
Date: Thu, 24 Apr 2025 10:02:10 +0200

> would provide a bit more clarity.

Note that PG18 supports prefetching on macOS without posix_fadvise(), 
and we changed some of the documentation text to not mention 
posix_fadvise() anymore.  Also, some of the text and the defaults have 
changed because of the async IO feature set.  Maybe see if the text in 
master provides the information you need.