Re: Use streaming read API in ANALYZE

2024-09-19 Thread Mats Kindahl
On Wed, Sep 18, 2024 at 5:13 AM Thomas Munro wrote: > On Sun, Sep 15, 2024 at 12:14 AM Mats Kindahl wrote: > > I used the combination of your patch and making the computation of > vacattrstats for a relation available through the API and managed to > implement something that I think does the rig

Re: Use streaming read API in ANALYZE

2024-09-17 Thread Thomas Munro
On Sun, Sep 15, 2024 at 12:14 AM Mats Kindahl wrote: > I used the combination of your patch and making the computation of > vacattrstats for a relation available through the API and managed to > implement something that I think does the right thing. (I just sampled a few > different statistics

Re: Use streaming read API in ANALYZE

2024-09-14 Thread Mats Kindahl
On Fri, Sep 13, 2024 at 10:10 AM Mats Kindahl wrote: > On Tue, Sep 10, 2024 at 6:04 AM Thomas Munro > wrote: > >> On Tue, Sep 10, 2024 at 10:27 AM Thomas Munro >> wrote: >> > Mats, what do you think about >> > this? (I haven't tried to preserve the prefetching behaviour, which >> > probably di

Re: Use streaming read API in ANALYZE

2024-09-13 Thread Mats Kindahl
On Tue, Sep 10, 2024 at 6:04 AM Thomas Munro wrote: > On Tue, Sep 10, 2024 at 10:27 AM Thomas Munro > wrote: > > Mats, what do you think about > > this? (I haven't tried to preserve the prefetching behaviour, which > > probably didn't actually too work for you in v16 anyway at a guess, > > I'm

Re: Use streaming read API in ANALYZE

2024-09-13 Thread Mats Kindahl
On Tue, Sep 10, 2024 at 12:28 AM Thomas Munro wrote: > On Tue, Sep 10, 2024 at 3:36 AM Michael Banck wrote: > > I am a bit confused about the status of this thread. Robert mentioned > > RC1, so I guess it pertains to v17 but I don't see it on the open item > > wiki list? > > Yes, v17. Alight, I

Re: Use streaming read API in ANALYZE

2024-09-10 Thread Mats Kindahl
On Thu, Sep 5, 2024 at 11:12 AM Thomas Munro wrote: > On Thu, Sep 5, 2024 at 6:45 PM Mats Kindahl wrote: > > Forgive me for asking, but I am not entirely sure why the ReadStream > struct is opaque. The usual reasons are: > > > > You want to provide an ABI to allow extensions to work with new maj

Re: Use streaming read API in ANALYZE

2024-09-09 Thread Thomas Munro
On Tue, Sep 10, 2024 at 10:27 AM Thomas Munro wrote: > Mats, what do you think about > this? (I haven't tried to preserve the prefetching behaviour, which > probably didn't actually too work for you in v16 anyway at a guess, > I'm just looking for the absolute simplest thing we can do to resolve

Re: Use streaming read API in ANALYZE

2024-09-09 Thread Thomas Munro
On Tue, Sep 10, 2024 at 3:36 AM Michael Banck wrote: > I am a bit confused about the status of this thread. Robert mentioned > RC1, so I guess it pertains to v17 but I don't see it on the open item > wiki list? Yes, v17. Alight, I'll add an item. > Does the above mean you are going to revert it

Re: Use streaming read API in ANALYZE

2024-09-09 Thread Michael Banck
Hi, On Thu, Sep 05, 2024 at 09:12:07PM +1200, Thomas Munro wrote: > On Thu, Sep 5, 2024 at 6:45 PM Mats Kindahl wrote: > > Making the ReadStream API non-opaque (that is, moving the definition > > to the header file) would at least solve our problem (unless I am > > mistaken). However, I am ignora

Re: Use streaming read API in ANALYZE

2024-09-05 Thread Thomas Munro
On Thu, Sep 5, 2024 at 6:45 PM Mats Kindahl wrote: > Forgive me for asking, but I am not entirely sure why the ReadStream struct > is opaque. The usual reasons are: > > You want to provide an ABI to allow extensions to work with new major > versions without re-compiling. Right now it is necessar

Re: Use streaming read API in ANALYZE

2024-09-04 Thread Mats Kindahl
On Thu, Sep 5, 2024 at 1:34 AM Thomas Munro wrote: > On Thu, Sep 5, 2024 at 3:36 AM Robert Haas wrote: > > On Wed, Sep 4, 2024 at 6:38 AM Thomas Munro > wrote: > > > Thanks for the explanation. I think we should revert it. IMHO it was > > > a nice clean example of a streaming transformation,

Re: Use streaming read API in ANALYZE

2024-09-04 Thread Thomas Munro
On Thu, Sep 5, 2024 at 3:36 AM Robert Haas wrote: > On Wed, Sep 4, 2024 at 6:38 AM Thomas Munro wrote: > > Thanks for the explanation. I think we should revert it. IMHO it was > > a nice clean example of a streaming transformation, but unfortunately > > it transformed an API that nobody liked i

Re: Use streaming read API in ANALYZE

2024-09-04 Thread Robert Haas
On Wed, Sep 4, 2024 at 6:38 AM Thomas Munro wrote: > Thanks for the explanation. I think we should revert it. IMHO it was > a nice clean example of a streaming transformation, but unfortunately > it transformed an API that nobody liked in the first place, and broke > some weird and wonderful wor

Re: Use streaming read API in ANALYZE

2024-09-04 Thread Thomas Munro
Thanks for the explanation. I think we should revert it. IMHO it was a nice clean example of a streaming transformation, but unfortunately it transformed an API that nobody liked in the first place, and broke some weird and wonderful workarounds. Let's try again in 18.

Re: Use streaming read API in ANALYZE

2024-08-29 Thread Mats Kindahl
On Sat, Aug 24, 2024 at 5:31 AM Thomas Munro wrote: > On Thu, Aug 22, 2024 at 7:31 PM Mats Kindahl wrote: > > The alternate version proposed by Nazir allows you to deide which > interface to use. > > Reverting the patch entirely would also solve the problem. > After digging through the code a l

Re: Use streaming read API in ANALYZE

2024-08-23 Thread Thomas Munro
On Thu, Aug 22, 2024 at 7:31 PM Mats Kindahl wrote: > The alternate version proposed by Nazir allows you to decide which interface > to use. > Reverting the patch entirely would also solve the problem. > Passing down the block sampler and the strategy to scan_begin() and move the > ReadStream se

Re: Use streaming read API in ANALYZE

2024-08-22 Thread Mats Kindahl
On Mon, May 20, 2024 at 10:46 PM Melanie Plageman wrote: > On Wed, May 15, 2024 at 2:18 PM Nazir Bilal Yavuz > wrote: > > > > On Mon, 29 Apr 2024 at 18:41, Nazir Bilal Yavuz > wrote: > > > > > > On Mon, 8 Apr 2024 at 04:21, Thomas Munro > wrote: > > > I wanted to discuss what will happen to th

Re: Use streaming read API in ANALYZE

2024-05-20 Thread Melanie Plageman
On Wed, May 15, 2024 at 2:18 PM Nazir Bilal Yavuz wrote: > > On Mon, 29 Apr 2024 at 18:41, Nazir Bilal Yavuz wrote: > > > > On Mon, 8 Apr 2024 at 04:21, Thomas Munro wrote: > > I wanted to discuss what will happen to this patch now that > > 27bc1772fc8 is reverted. I am continuing this thread bu

Re: Use streaming read API in ANALYZE

2024-05-15 Thread Nazir Bilal Yavuz
Hi, On Mon, 29 Apr 2024 at 18:41, Nazir Bilal Yavuz wrote: > > Hi, > > On Mon, 8 Apr 2024 at 04:21, Thomas Munro wrote: > > > > Pushed. Thanks Bilal and reviewers! > > I wanted to discuss what will happen to this patch now that > 27bc1772fc8 is reverted. I am continuing this thread but I can cr

Re: Use streaming read API in ANALYZE

2024-04-29 Thread Nazir Bilal Yavuz
Hi, On Mon, 8 Apr 2024 at 04:21, Thomas Munro wrote: > > Pushed. Thanks Bilal and reviewers! I wanted to discuss what will happen to this patch now that 27bc1772fc8 is reverted. I am continuing this thread but I can create another thread if you prefer so. After the revert of 27bc1772fc8, acqui

Re: Use streaming read API in ANALYZE

2024-04-16 Thread Nazir Bilal Yavuz
Hi, On Wed, 3 Apr 2024 at 22:25, Nazir Bilal Yavuz wrote: > > Hi, > > Thank you for looking into this! > > On Wed, 3 Apr 2024 at 20:17, Heikki Linnakangas wrote: > > > > On 03/04/2024 13:31, Nazir Bilal Yavuz wrote: > > > Streaming API has been committed but the committed version has a minor > >

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Thomas Munro
On Mon, Apr 8, 2024 at 10:26 AM Melanie Plageman wrote: > On Sun, Apr 07, 2024 at 03:00:00PM -0700, Andres Freund wrote: > > On 2024-04-07 16:59:26 -0400, Melanie Plageman wrote: > > > From 862b7ac81cdafcda7b525e02721da14e46265509 Mon Sep 17 00:00:00 2001 > > > From: Melanie Plageman > > > Date:

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Thomas Munro
On Mon, Apr 8, 2024 at 10:26 AM Melanie Plageman wrote: > On Sun, Apr 07, 2024 at 03:00:00PM -0700, Andres Freund wrote: > > > src/backend/commands/analyze.c | 89 ++ > > > 1 file changed, 26 insertions(+), 63 deletions(-) > > > > That's a very nice demonstration o

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Melanie Plageman
On Sun, Apr 07, 2024 at 03:00:00PM -0700, Andres Freund wrote: > Hi, > > On 2024-04-07 16:59:26 -0400, Melanie Plageman wrote: > > From 1dc2343661f3edb3b1bc4307afb0e956397eb76c Mon Sep 17 00:00:00 2001 > > From: Melanie Plageman > > Date: Sun, 7 Apr 2024 14:55:22 -0400 > > Subject: [PATCH v10 1/3

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Andres Freund
Hi, On 2024-04-07 16:59:26 -0400, Melanie Plageman wrote: > From 1dc2343661f3edb3b1bc4307afb0e956397eb76c Mon Sep 17 00:00:00 2001 > From: Melanie Plageman > Date: Sun, 7 Apr 2024 14:55:22 -0400 > Subject: [PATCH v10 1/3] Make heapam_scan_analyze_next_[tuple|block] static. > > 27bc1772fc81 remov

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Melanie Plageman
On Sun, Apr 7, 2024 at 3:57 PM Melanie Plageman wrote: > > On Thu, Apr 04, 2024 at 02:03:30PM +0300, Nazir Bilal Yavuz wrote: > > > > On Wed, 3 Apr 2024 at 23:44, Melanie Plageman > > wrote: > > > > > > I don't see the point of BlockSampler_HasMore() anymore. I removed it in > > > the attached a

Re: Use streaming read API in ANALYZE

2024-04-07 Thread Melanie Plageman
On Thu, Apr 04, 2024 at 02:03:30PM +0300, Nazir Bilal Yavuz wrote: > > On Wed, 3 Apr 2024 at 23:44, Melanie Plageman > wrote: > > > > I don't see the point of BlockSampler_HasMore() anymore. I removed it in > > the attached and made BlockSampler_Next() return InvalidBlockNumber > > under the sam

Re: Use streaming read API in ANALYZE

2024-04-04 Thread Nazir Bilal Yavuz
Hi, On Wed, 3 Apr 2024 at 23:44, Melanie Plageman wrote: > > > I've reviewed the patches inline below and attached a patch that has > some of my ideas on top of your patch. Thank you! > > > From 8d396a42186325f920d5a05e7092d8e1b66f3cdf Mon Sep 17 00:00:00 2001 > > From: Nazir Bilal Yavuz > > D

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Melanie Plageman
On Wed, Apr 03, 2024 at 10:25:01PM +0300, Nazir Bilal Yavuz wrote: > > I realized the same error while working on Jakub's benchmarking results. > > Cause: I was using the nblocks variable to check how many blocks will > be returned from the streaming API. But I realized that sometimes the > number

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Nazir Bilal Yavuz
Hi, Thank you for looking into this! On Wed, 3 Apr 2024 at 20:17, Heikki Linnakangas wrote: > > On 03/04/2024 13:31, Nazir Bilal Yavuz wrote: > > Streaming API has been committed but the committed version has a minor > > change, the read_stream_begin_relation function takes Relation instead > >

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Nazir Bilal Yavuz
Hi Jakub, Thank you for looking into this and doing a performance analysis. On Wed, 3 Apr 2024 at 11:42, Jakub Wartak wrote: > > On Tue, Apr 2, 2024 at 9:24 AM Nazir Bilal Yavuz wrote: > [..] > > v4 is rebased on top of v14 streaming read API changes. > > Hi Nazir, so with streaming API committ

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Heikki Linnakangas
On 03/04/2024 13:31, Nazir Bilal Yavuz wrote: Streaming API has been committed but the committed version has a minor change, the read_stream_begin_relation function takes Relation instead of BufferManagerRelation now. So, here is a v5 which addresses this change. I'm getting a repeatable segfau

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Nazir Bilal Yavuz
Hi, On Tue, 2 Apr 2024 at 10:23, Nazir Bilal Yavuz wrote: > > v4 is rebased on top of v14 streaming read API changes. Streaming API has been committed but the committed version has a minor change, the read_stream_begin_relation function takes Relation instead of BufferManagerRelation now. So, he

Re: Use streaming read API in ANALYZE

2024-04-03 Thread Jakub Wartak
On Tue, Apr 2, 2024 at 9:24 AM Nazir Bilal Yavuz wrote: [..] > v4 is rebased on top of v14 streaming read API changes. Hi Nazir, so with streaming API committed, I gave a try to this patch. With autovacuum=off and 30GB table on NVMe (with standard readahead of 256kb and ext4, Debian 12, kernel 6.

Re: Use streaming read API in ANALYZE

2024-04-02 Thread Nazir Bilal Yavuz
Hi, Thanks for the review! On Wed, 27 Mar 2024 at 23:15, Melanie Plageman wrote: > > On Tue, Mar 26, 2024 at 02:51:27PM +0300, Nazir Bilal Yavuz wrote: > > Hi, > > > > On Wed, 28 Feb 2024 at 14:42, Nazir Bilal Yavuz wrote: > > > > > > > > > The new version of the streaming read API [1] is poste

Re: Use streaming read API in ANALYZE

2024-03-27 Thread Melanie Plageman
On Tue, Mar 26, 2024 at 02:51:27PM +0300, Nazir Bilal Yavuz wrote: > Hi, > > On Wed, 28 Feb 2024 at 14:42, Nazir Bilal Yavuz wrote: > > > > > > The new version of the streaming read API [1] is posted. I updated the > > streaming read API changes patch (0001), using the streaming read API > > in A

Re: Use streaming read API in ANALYZE

2024-03-26 Thread Nazir Bilal Yavuz
Hi, On Wed, 28 Feb 2024 at 14:42, Nazir Bilal Yavuz wrote: > > > The new version of the streaming read API [1] is posted. I updated the > streaming read API changes patch (0001), using the streaming read API > in ANALYZE patch (0002) remains the same. This should make it easier > to review as it

Re: Use streaming read API in ANALYZE

2024-02-28 Thread Nazir Bilal Yavuz
Hi, On Mon, 19 Feb 2024 at 18:13, Nazir Bilal Yavuz wrote: > > I worked on using the currently proposed streaming read API [1] in ANALYZE. > The patch is attached. 0001 is the not yet merged streaming read API code > changes that can be applied to the master, 0002 is the actual code. > > The bl