[ 
https://issues.apache.org/jira/browse/IGNITE-17711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610190#comment-17610190
 ] 

Aleksandr Polovtcev commented on IGNITE-17711:
----------------------------------------------

This idea, unfortunately, doesn't make a lot of sense: it will be possible to 
compare the tuples without serialization, but it will require quite a lot of 
code (i.e. to compare parts of the null map and then the value area slices). It 
would be easier to store the desired comparison result inside the prefix, so 
that it can be used by the Rocks comparator to include or exclude the prefix 
bounds. However, this ticket is still useful, because it makes it easy to 
create prefixes from a full binary tuple.

> Change Binary Tuple Prefix format to allow comparison without deserialization
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-17711
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17711
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Aleksandr Polovtcev
>            Assignee: Aleksandr Polovtcev
>            Priority: Minor
>              Labels: ignite-3
>
> BinaryTuplePrefix format dictates that the number of prefix elements are 
> appended to the end of the tuple. This is currently implemented as inserting 
> an extra int element which also implies an extra entry in the offset map and 
> non-deterministic size of this element (it can occupy from 1 to 4 bytes). 
> This was done for the sake of simplicity but it also has an implication: it 
> is not possible to simply compare it with a BinaryTuple byte-by-byte in order 
> to determine if a given prefix matches a given tuple. A better approach would 
> be to append the number of elements directly as the last two bytes (or four, 
> if necessary) of the tuple, bypassing the entry table. This way we can 
> discard the last two bytes and compare the prefix and the tuple on a per-byte 
> basis.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to