On Tue, Mar 14, 2023 at 02:02:19PM +0900, Kyotaro Horiguchi wrote: > Regarding huge_page_active, its value remains constant throughout a > postmaster's lifespan. In this regard, GUC may be a better fit for > this information. The issue with using GUC for this value is that the > postgres command cannot report the final value via the -C option, > which may be the reason for the third alternative "unknown". > > I slightly prefer using a function for this, as if GUC is used, it can > only return "unknown" for the command "postgres -C > huge_page_active". However, apart from this advantage, I prefer using > a GUC for this information.
The main advantage of a read-only GUC over a function is that users would not need to start a postmaster to know if huge pages would be active or not. This is the main reason why a GUC would be a better fit, in my opinion, because it makes for a cheaper check, while still allowing a SQL query to check the value of the GUC. -- Michael
signature.asc
Description: PGP signature