Skip to content

Conversation

@joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Sep 11, 2023

Description of Changes

Re-introduces the changes of #268 with a fix for improperly decoding the DataKey.

The original patch tried to encode a byte slice in to_mem_table using DataKey::from_data rather than DataKey::decode. The former assumes the byte slice is data only, the latter assumes it is a proper DataKey encoding.

Tested against #258

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

@joshua-spacetime joshua-spacetime force-pushed the joshua/259/data-key-optimization branch 2 times, most recently from e835bb2 to 684258b Compare September 11, 2023 23:49
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

Looks good, though I have some suggestions:

impl DataRef {
fn new(data: ProductValue) -> Self {
Self { data }
fn new(id: DataKey, data: ProductValue) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this take RowId instead?

Suggested change
fn new(id: DataKey, data: ProductValue) -> Self {
fn new(id: RowId, data: ProductValue) -> Self {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we gain anything from the extra indirection?

Copy link
Contributor

Choose a reason for hiding this comment

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

From what I could tell, all calls to this function essentially does row_id.0, so I figured this would be slightly more "strongly typed".

@joshua-spacetime joshua-spacetime force-pushed the joshua/259/data-key-optimization branch from 5629348 to 6a9c13d Compare September 12, 2023 15:04
)

Fixes #259 

(1) Updates MemTable to use RelValue instead of ProductValue
(2) Adds a DataKey member to DataRef and RelValue
(3) Subscriptions compute DataKey only when not present on row
@joshua-spacetime joshua-spacetime force-pushed the joshua/259/data-key-optimization branch from e9c4a59 to dba0b96 Compare September 12, 2023 21:59
@joshua-spacetime joshua-spacetime merged commit cc36a2e into master Sep 12, 2023
@joshua-spacetime joshua-spacetime deleted the joshua/259/data-key-optimization branch September 12, 2023 22:16
@joshua-spacetime joshua-spacetime linked an issue Sep 12, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove RowID computation from subscription evaluation

3 participants