Re: Add LSN <-> time conversion functionality

2024-05-30 Thread Andrey M. Borodin
Hi everyone! Me, Bharath, and Ilya are on patch review session at the PGConf.dev :) Maybe we got everything wrong, please consider that we are just doing training on reviewing patches. === Purpose of the patch === Currently, we have checkpoint_timeout and max_wal size to know when we need a

Re: Add LSN <-> time conversion functionality

2024-03-18 Thread Tomas Vondra
On 3/18/24 15:02, Daniel Gustafsson wrote: >> On 22 Feb 2024, at 03:45, Melanie Plageman wrote: >> On Fri, Feb 16, 2024 at 3:41 PM Tomas Vondra >> wrote: > >>> - Not sure why we need 0001. Just so that the "estimate" functions in >>> 0002 have a convenient "start" point? Surely we could look

Re: Add LSN <-> time conversion functionality

2024-03-18 Thread Tomas Vondra
On 2/22/24 03:45, Melanie Plageman wrote: > Thanks so much for reviewing! > > On Fri, Feb 16, 2024 at 3:41 PM Tomas Vondra > wrote: >> >> When I first read this, I immediately started wondering if this might >> use the commit timestamp stuff we already have. Because for each commit >> we

Re: Add LSN <-> time conversion functionality

2024-03-18 Thread Daniel Gustafsson
> On 22 Feb 2024, at 03:45, Melanie Plageman wrote: > On Fri, Feb 16, 2024 at 3:41 PM Tomas Vondra > wrote: >> - Not sure why we need 0001. Just so that the "estimate" functions in >> 0002 have a convenient "start" point? Surely we could look at the >> current LSNTimeline data and use the

Re: Add LSN <-> time conversion functionality

2024-02-21 Thread Melanie Plageman
Thanks so much for reviewing! On Fri, Feb 16, 2024 at 3:41 PM Tomas Vondra wrote: > > When I first read this, I immediately started wondering if this might > use the commit timestamp stuff we already have. Because for each commit > we already store the LSN and commit timestamp, right? But I'm

Re: Add LSN <-> time conversion functionality

2024-02-16 Thread Tomas Vondra
Hi, I took a look at this today, to try to understand the purpose and how it works. Let me share some initial thoughts and questions I have. Some of this may be wrong/missing the point, so apologies for that. The goal seems worthwhile in general - the way I understand it, the patch aims to

Re: Add LSN <-> time conversion functionality

2024-01-30 Thread Melanie Plageman
On Wed, Dec 27, 2023 at 5:16 PM Melanie Plageman wrote: > > Elsewhere [1] I required a way to estimate the time corresponding to a > particular LSN in the past. I devised the attached LSNTimeline, a data > structure mapping LSNs <-> timestamps with decreasing precision for > older time, LSN

Add LSN <-> time conversion functionality

2023-12-27 Thread Melanie Plageman
Hi, Elsewhere [1] I required a way to estimate the time corresponding to a particular LSN in the past. I devised the attached LSNTimeline, a data structure mapping LSNs <-> timestamps with decreasing precision for older time, LSN pairs. This can be used to locate and translate a particular time