Skip to content
Snippets Groups Projects
Commit 9b8062d5 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy
Browse files

vinyl: decrease usage of vy_mem_older_lsn

Do not call vy_mem_older_lsn on each UPSERT commit. Older lsn
statement is used to squash big count of upserts and to turn
UPSERT into REPLACE, if the older statement has appeared to be
not UPSERT.
But n_upserts could be calculated on prepare phase almost free,
because the bps has method bps_insert_get_iterator, which
returns iterator to the inserted statement. We can move this
iterator forward to the older lsn without searching in the tree and
update n_upserts.

On a commit phase we can get the n_upserts, calculated on a prepare
phase, and call vy_mem_older_lsn only if there is a sense to
optimize the UPSERT.

Closes #1988
parent 95e9a101
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment