Re: Use streaming read API in pgstattuple.

2024-12-05 Thread Kirill Reshke
Hm, CI fails[0] This is most likely the reason why `select pgstattuple('test_hashidx');` was omitted in pgstattuple tests: we are not guaranteed about the number of bucket_pages in the empty index. Maybe we should populate base relation and check for only non-volatile fields like live_items and ver

Re: Use streaming read API in pgstattuple.

2024-12-05 Thread Kirill Reshke
On Fri, 29 Nov 2024 at 22:05, Matheus Alcantara wrote: > Just for reference; On pg_prewarm() for example this loop is > implemented as: > > for (block = first_block; block <= last_block; ++block) > { > Buffer buf; > ... > buf = read_stream_next_buffer(stream, NULL); >

Re: Use streaming read API in pgstattuple.

2024-12-02 Thread Nazir Bilal Yavuz
Hi, On Fri, 29 Nov 2024 at 20:05, Matheus Alcantara wrote: > > Hi, > > > On 29/11/24 04:28, Nazir Bilal Yavuz wrote: > > -for (; blkno < nblocks; blkno++) > > +p.last_exclusive = nblocks; > > + > > +while (BufferIsValid(buf = read_stream_next_buffer(stream, NULL))) > >

Re: Use streaming read API in pgstattuple.

2024-11-29 Thread Matheus Alcantara
Hi, On 29/11/24 04:28, Nazir Bilal Yavuz wrote: -for (; blkno < nblocks; blkno++) +p.last_exclusive = nblocks; + +while (BufferIsValid(buf = read_stream_next_buffer(stream, NULL))) { CHECK_FOR_INTERRUPTS(); -pagefn(&stat, rel, blkno,

Re: Use streaming read API in pgstattuple.

2024-11-28 Thread Nazir Bilal Yavuz
Hi, > Hello! Thank you for taking a peek. Your review comments have been > corrected. Since my changes were wrong, I honestly don't know why this > worked in version 1. By a miracle. > > As for CI, i rechecked v1: > > ``` > db2=# > select * from pgstathashindex('test_hashidx'); > version | bucket

Re: Use streaming read API in pgstattuple.

2024-11-27 Thread Kirill Reshke
On Tue, 26 Nov 2024 at 15:39, Nazir Bilal Yavuz wrote: > > Hi, > > Thank you for working on this! > > On Mon, 25 Nov 2024 at 21:17, Kirill Reshke wrote: > > While reviewing other threads implementing stream API for various core > > subsystems, I spotted that pgstattuple could also benefit from th

Re: Use streaming read API in pgstattuple.

2024-11-26 Thread Nazir Bilal Yavuz
Hi, Thank you for working on this! On Mon, 25 Nov 2024 at 21:17, Kirill Reshke wrote: > While reviewing other threads implementing stream API for various core > subsystems, I spotted that pgstattuple could also benefit from that. > So, PFA. > > Notice refactoring around pgstat_hash_page and chan