Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-04-11 Thread torikoshia
On 2025-03-25 10:27, torikoshia wrote: On 2025-03-22 20:23, Jelte Fennema-Nio wrote: On Wed, 19 Mar 2025 at 14:15, torikoshia wrote: BTW based on your discussion, I thought this patch could not be merged anytime soon. Does that align with your understanding? Yeah, that aligns with my under

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-03-24 Thread torikoshia
On 2025-03-22 20:23, Jelte Fennema-Nio wrote: On Wed, 19 Mar 2025 at 14:15, torikoshia wrote: BTW based on your discussion, I thought this patch could not be merged anytime soon. Does that align with your understanding? Yeah, that aligns with my understanding. I don't think it's realistic to

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-03-22 Thread Jelte Fennema-Nio
On Wed, 19 Mar 2025 at 14:15, torikoshia wrote: > BTW based on your discussion, I thought this patch could not be merged > anytime soon. Does that align with your understanding? Yeah, that aligns with my understanding. I don't think it's realistic to get this merged before the code freeze, but I

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-03-19 Thread torikoshia
Hi, On 2025-03-18 08:52, Jelte Fennema-Nio wrote: On Mon, 10 Feb 2025 at 14:23, torikoshia wrote: Thanks for reviewing the patch and comments! Fixed issues you pointed out and attached v2 patch. This patch needs a rebase, because it's failing to compile currently. So I marked this as "Waitin

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-03-17 Thread Jelte Fennema-Nio
On Mon, 10 Feb 2025 at 14:23, torikoshia wrote: > Thanks for reviewing the patch and comments! > Fixed issues you pointed out and attached v2 patch. This patch needs a rebase, because it's failing to compile currently. So I marked this as "Waiting on Author" in the commitfest app.

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Andres Freund
Hi, On 2025-02-11 18:45:13 +0100, Jelte Fennema-Nio wrote: > On Tue, 11 Feb 2025 at 17:19, Andres Freund wrote: > > Yes, at least initially: > > Ah, then I understand your point of view much better. Still I think we > could easily frame it as: If you enable io_uring, you also get these > additio

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Jelte Fennema-Nio
On Tue, 11 Feb 2025 at 17:19, Andres Freund wrote: > Yes, at least initially: Ah, then I understand your point of view much better. Still I think we could easily frame it as: If you enable io_uring, you also get these additional fancy stats. Also afaict the items don't have to mean that > 1) it

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Andres Freund
Hi, On 2025-02-11 17:00:36 +0100, Jelte Fennema-Nio wrote: > On Tue, 11 Feb 2025 at 16:36, Andres Freund wrote: > > Shrug. It means that it'll not work in what I hope will be the default > > mechanism before long. I just can't get excited for that. In all likelihood > > it'll result in bug repor

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Jelte Fennema-Nio
On Tue, 11 Feb 2025 at 16:36, Andres Freund wrote: > Shrug. It means that it'll not work in what I hope will be the default > mechanism before long. I just can't get excited for that. In all likelihood > it'll result in bug reports that I'll then be on the hook to fix. My assumption was that io_

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Andres Freund
Hi, On 2025-02-11 09:59:43 +0100, Jelte Fennema-Nio wrote: > On Tue, 11 Feb 2025 at 00:53, Andres Freund wrote: > > > The thing is that you'd often get completely misleading stats. Some of > > > the IO > > > will still be done by the backend itself, so there will be a non-zero > > > value. But i

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-11 Thread Jelte Fennema-Nio
On Tue, 11 Feb 2025 at 00:53, Andres Freund wrote: > > I mostly meant worker based AIO, yes. I haven't checked how accurately these > > are kept for io_uring. I would hope they are... > > It does look like it is tracked. nice! > > The thing is that you'd often get completely misleading stats. So

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-10 Thread Andres Freund
Hi, On 2025-02-10 18:30:56 -0500, Andres Freund wrote: > On 2025-02-10 23:52:17 +0100, Jelte Fennema-Nio wrote: > > On Mon, 10 Feb 2025 at 14:31, Andres Freund wrote: > > > But this will also not work with AIO w/ Buffered IO. Which we hope to use > > > much > > > more commonly. > > > > To be cle

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-10 Thread Andres Freund
Hi, On 2025-02-10 23:52:17 +0100, Jelte Fennema-Nio wrote: > On Mon, 10 Feb 2025 at 14:31, Andres Freund wrote: > > But this will also not work with AIO w/ Buffered IO. Which we hope to use > > much > > more commonly. > > To be clear, here you mean worker based AIO right? Because it would > wor

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-10 Thread Jelte Fennema-Nio
On Mon, 10 Feb 2025 at 14:31, Andres Freund wrote: > I think it'll always be a subset of use. It doesn't make sense to use DIO for > a small databases or untuned databases. Or a system that's deliberately > overcommmitted. Thanks, that's useful context. > But this will also not work with AIO w/

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-10 Thread Andres Freund
Hi, On 2025-02-09 21:06:02 +0100, Jelte Fennema-Nio wrote: > On Sun, 9 Feb 2025 at 19:05, Tom Lane wrote: > > > > Andres Freund writes: > > > I'm somewhat against this patch, as it's fairly fundamentally incompatible > > > with AIO. There's no real way to get information in this manner if the IO

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-10 Thread torikoshia
On 2025-02-10 05:06, Jelte Fennema-Nio wrote: Thanks for reviewing the patch and comments! Fixed issues you pointed out and attached v2 patch. On Sun, 9 Feb 2025 at 19:05, Tom Lane wrote: Andres Freund writes: > I'm somewhat against this patch, as it's fairly fundamentally incompatible > wi

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-09 Thread Jelte Fennema-Nio
On Sun, 9 Feb 2025 at 19:05, Tom Lane wrote: > > Andres Freund writes: > > I'm somewhat against this patch, as it's fairly fundamentally incompatible > > with AIO. There's no real way to get information in this manner if the IO > > isn't executed synchronously in process context... Hmm, I had no

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-09 Thread Tom Lane
Andres Freund writes: > I'm somewhat against this patch, as it's fairly fundamentally incompatible > with AIO. There's no real way to get information in this manner if the IO > isn't executed synchronously in process context... Even without looking ahead to AIO, there's bgwriter, walwriter, and c

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-09 Thread Andres Freund
Hi, On 2025-02-09 12:51:40 +0100, Jelte Fennema-Nio wrote: > On Sat, 8 Feb 2025 at 14:54, Jelte Fennema-Nio wrote: > > I'll play around with it a bit next week. > > Okay, I played around with it and couldn't find any issues. I marked > the patch as "ready for committer" in the commitfest app[1],

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-09 Thread Jelte Fennema-Nio
On Sat, 8 Feb 2025 at 14:54, Jelte Fennema-Nio wrote: > I'll play around with it a bit next week. Okay, I played around with it and couldn't find any issues. I marked the patch as "ready for committer" in the commitfest app[1], given that all feedback in my previous email was very minor. [1]: ht

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-02-08 Thread Jelte Fennema-Nio
On Mon, 27 Jan 2025 at 10:05, torikoshia wrote: > Therefore, I believe it would be reasonable to report the raw values > as-is, as they should still be useful for understanding storage I/O > activity. Sounds reasonable. Below some feedback on the patch. It's all really minor. The patch looks gre

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-01-27 Thread torikoshia
Hi, On Tue, Jan 7, 2025 at 5:09 AM Jelte Fennema-Nio wrote: The core functionality works well in my opinion. I think it makes sense to spend the effort to move this from PoC quality to something committable. Below some of the things that are necessary to do that after an initial pass over the

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-01-07 Thread Atsushi Torikoshi
On Mon, Jan 6, 2025 at 6:59 PM Julien Rouhaud wrote: > Hi, > > On Mon, Jan 06, 2025 at 06:49:06PM +0900, torikoshia wrote: > > > > > **However, I think the general direction has merit**: Changing this > > > patch to > > > use `ru_inblock`/`ru_oublock` gives very useful insights. `ru_inblock` > >

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-01-06 Thread Jelte Fennema-Nio
On Mon Jan 6, 2025 at 10:49 AM CET, torikoshia wrote: On Tue, Dec 31, 2024 at 7:57 AM Jelte Fennema-Nio Updated the PoC patch to calculate them by KB: =# EXPLAIN (ANALYZE, STORAGEIO) SELECT * FROM pgbench_accounts; QUERY PLAN

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-01-06 Thread Julien Rouhaud
Hi, On Mon, Jan 06, 2025 at 06:49:06PM +0900, torikoshia wrote: > > > **However, I think the general direction has merit**: Changing this > > patch to > > use `ru_inblock`/`ru_oublock` gives very useful insights. `ru_inblock` > > is 0 when everything is in page cache, and it is very high when stuf

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2025-01-06 Thread torikoshia
On Tue, Dec 31, 2024 at 1:39 AM Tom Lane wrote: Bruce Momjian writes: I certainly would love to see storage I/O numbers as distinct from kernel read I/O numbers. Me too, but I think it is 100% wishful thinking to imagine that page fault counts match up with that. Maybe there are filesyste

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-30 Thread Jelte Fennema-Nio
On Mon Dec 30, 2024 at 5:39 PM CET, Tom Lane wrote: Bruce Momjian writes: I certainly would love to see storage I/O numbers as distinct from kernel read I/O numbers. Me too, but I think it is 100% wishful thinking to imagine that page fault counts match up with that. Okay I played around

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-30 Thread Tom Lane
Bruce Momjian writes: > On Fri, Dec 27, 2024 at 03:15:40PM +0100, Jelte Fennema-Nio wrote: >> On Tue Dec 24, 2024 at 4:52 PM CET, Tom Lane wrote: >>> torikoshia writes: I have attached a PoC patch that modifies EXPLAIN to include page fault information during both the planning and execu

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-30 Thread Bruce Momjian
On Fri, Dec 27, 2024 at 03:15:40PM +0100, Jelte Fennema-Nio wrote: > On Tue Dec 24, 2024 at 4:52 PM CET, Tom Lane wrote: > > torikoshia writes: > > > I have attached a PoC patch that modifies EXPLAIN to include page > > > fault information during both the planning and execution phases of a > > > q

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-27 Thread Jeremy Schneider
On Fri, 27 Dec 2024 15:15:40 +0100 "Jelte Fennema-Nio" wrote: > On Tue Dec 24, 2024 at 4:52 PM CET, Tom Lane wrote: > > torikoshia writes: > >> I have attached a PoC patch that modifies EXPLAIN to include page > >> fault information during both the planning and execution phases of > >> a query

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-27 Thread Jelte Fennema-Nio
On Tue Dec 24, 2024 at 4:52 PM CET, Tom Lane wrote: torikoshia writes: I have attached a PoC patch that modifies EXPLAIN to include page fault information during both the planning and execution phases of a query. Surely these numbers would be too unstable to be worth anything. What makes y

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-26 Thread Jeremy Schneider
On Thu, 26 Dec 2024 13:15:59 +0900 torikoshia wrote: > On 2024-12-25 00:52, Tom Lane wrote: > > torikoshia writes: > >> I have attached a PoC patch that modifies EXPLAIN to include page > >> fault > >> information during both the planning and execution phases of a > >> query. > > > > Surel

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-25 Thread torikoshia
On 2024-12-25 00:52, Tom Lane wrote: torikoshia writes: I have attached a PoC patch that modifies EXPLAIN to include page fault information during both the planning and execution phases of a query. Surely these numbers would be too unstable to be worth anything. Thanks for your comment! H

Re: RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-24 Thread Tom Lane
torikoshia writes: > I have attached a PoC patch that modifies EXPLAIN to include page fault > information during both the planning and execution phases of a query. Surely these numbers would be too unstable to be worth anything. regards, tom lane

RFC: Allow EXPLAIN to Output Page Fault Information

2024-12-24 Thread torikoshia
Hi, When reading the output of EXPLAIN (ANALYZE) to diagnose slow queries for our customers, I often want to know how many page faults occurred, especially major page faults, which involve disk access. Currently, the BUFFERS option in EXPLAIN provides information on whether a page was found