Skip to content

Conversation

@danolivo
Copy link
Contributor

Now, each apply progress HTAB entry contains tangled values of remote_commit_lsn and remote_commit_ts columns (see handle_commit). So, when extracting data from the progress view, we can use any of these numbers, and using LSN streamlines the check_commit_timestamp_and_advance_slot procedure: we can directly point to the correct WAL record, avoiding the expensive get_lsn_from_commit_ts() call.

So, replace the expensive search for the proper LSN with direct picking of a specific WAL record.

TODO:
Further commits should also change the Python version. And consequently, remove the function get_lsn_from_commit_ts() from the extension altogether.

Now, each apply progress HTAB entry contains tangled values of
remote_commit_lsn and remote_commit_ts columns (see handle_commit). So, when
extracting data from the progress view, we can use any of these numbers, and
using LSN streamlines the check_commit_timestamp_and_advance_slot procedure:
we can directly point to the correct WAL record, avoiding the expensive
get_lsn_from_commit_ts() call.

So, replace the expensive search for the proper LSN with direct picking of
a specific WAL record.

TODO:
Further commits should also change the Python version. And consequently,
remove the function get_lsn_from_commit_ts() from the extension altogether.
@danolivo danolivo self-assigned this Dec 10, 2025
@danolivo danolivo added the enhancement New feature or request label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants