[
https://issues.apache.org/jira/browse/IGNITE-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksandr Polovtcev updated IGNITE-17818:
-----------------------------------------
Description:
When scanning for data in the RocksDB-based sorted index storage, we need to
perform additional queries in case the lower scan bound is exclusive or the
upper scan bound is inclusive.
This behavior can be optimized by setting an additional bit somewhere in the
prefix and interpreting it in the following way: if the bit is not set and the
prefix columns are equal to first N columns of the full tuple (where N is the
number of columns in the prefix), then this prefix should be treated as
_smaller_ than the full tuple. Otherwise, if the bit is set and the prefix
columns are equal to first N columns of the full tuple, then this prefix should
be treated as _larger_ than the full tuple.
Using this approach, we can optimize the storage as following:
# If the lower bound is provided and GREATER_OR_EQUAL flag is not set: set the
bit to 1. This way the lower bound will not be included as it will be
considered larger than the value that starts with it.
# If the lower bound is provided and GREATER_OR_EQUAL flag is set: set the bit
to 0. This way the lower bound will be included as it will be considered
smaller than the value that starts with it.
# Upper bound should be handled in the opposite way: set the flag to 0 when
LESS_OR_EQUAL is not set, and set the flag to 1 when LESS_OR_EQUAL is set.
> Store comparison results in BinaryTuplePrefix
> ---------------------------------------------
>
> Key: IGNITE-17818
> URL: https://issues.apache.org/jira/browse/IGNITE-17818
> Project: Ignite
> Issue Type: Task
> Reporter: Aleksandr Polovtcev
> Assignee: Aleksandr Polovtcev
> Priority: Major
> Labels: ignite-3
>
> When scanning for data in the RocksDB-based sorted index storage, we need to
> perform additional queries in case the lower scan bound is exclusive or the
> upper scan bound is inclusive.
> This behavior can be optimized by setting an additional bit somewhere in the
> prefix and interpreting it in the following way: if the bit is not set and
> the prefix columns are equal to first N columns of the full tuple (where N is
> the number of columns in the prefix), then this prefix should be treated as
> _smaller_ than the full tuple. Otherwise, if the bit is set and the prefix
> columns are equal to first N columns of the full tuple, then this prefix
> should be treated as _larger_ than the full tuple.
> Using this approach, we can optimize the storage as following:
> # If the lower bound is provided and GREATER_OR_EQUAL flag is not set: set
> the bit to 1. This way the lower bound will not be included as it will be
> considered larger than the value that starts with it.
> # If the lower bound is provided and GREATER_OR_EQUAL flag is set: set the
> bit to 0. This way the lower bound will be included as it will be considered
> smaller than the value that starts with it.
> # Upper bound should be handled in the opposite way: set the flag to 0 when
> LESS_OR_EQUAL is not set, and set the flag to 1 when LESS_OR_EQUAL is set.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)