Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

cache key values in iterator store in db_context_rocksdb #10093

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

linhuang-blockone
Copy link
Contributor

@linhuang-blockone linhuang-blockone commented Feb 25, 2021

Change Description

https://blockone.atlassian.net/browse/EPE-786

Cache primary key values when first retrieving them in db_find_i64 and iterator functions.
Use them in db_get_i64, db_update_i64, and db_remove_i64.

This PR is based on Brian's #9997. Thanks Brian. It fixes a bug in the original PR, and makes db_update_i64 and db_move_i64 to use cached values too.

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions


const payer_payload pp{payer, value, value_size};
set_value(old_key_value.full_key, pp);
prefix_bundle old_key = get_primary_slice_in_primaries(table_store.contract, table_store.scope,table_store.table, key_store.primary);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_primary_slice_in_primaries creates an extra key that we don't use, so we could create a new method that just creates the key_bundle instead of a prefix_bundle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion. Will create a new method in a future PR in the performance activity.

}

current_session.erase(old_key_value.full_key);
primary_lookup.remove_table_if_empty(old_key_value.full_key);
prefix_bundle old_key = get_primary_slice_in_primaries(table_store.contract, table_store.scope,table_store.table, key_store.primary);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other comment applies here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do it in a future PR.

@linhuang-blockone linhuang-blockone merged commit 300e330 into develop Mar 18, 2021
@linhuang-blockone linhuang-blockone deleted the cache_value_in_db_context_rocksdb branch March 18, 2021 16:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants