[
https://issues.apache.org/jira/browse/FLINK-30475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651921#comment-17651921
]
Yanfei Lei commented on FLINK-30475:
------------------------------------
Hi [~b923], this optimization may increase the number of tombstones. As the
[blog|https://rocksdb.org/blog/2018/11/21/delete-range.html] says, deleteRange
would bring some regression on Point Lookups and Range Scans.
FLINK-28010 has been tried to optimize RocksDBMapState#clear() with
deleteRange(), but the experimental results of
[iterator|https://github.com/apache/flink/pull/20405#discussion_r951119238] are
not as expected. Do you have different experimental results?
> Improved speed of RocksDBMapState clear() using rocksDB.deleteRange
> -------------------------------------------------------------------
>
> Key: FLINK-30475
> URL: https://issues.apache.org/jira/browse/FLINK-30475
> Project: Flink
> Issue Type: Improvement
> Components: Runtime / State Backends
> Affects Versions: 1.16.0
> Reporter: David Hrbacek
> Priority: Major
> Labels: pull-request-available
>
> Currently {{RocksDBMapState#clear()}} is processed via keyRange traversing
> and inserting particular keys into BatchWrite for deletion.
> RocksDb offer much faster way how to delete key range - {{deleteRange}}
> This issue is follow-up for
> [FLINK-9070|https://issues.apache.org/jira/browse/FLINK-9070] where
> {{deleteRange}} was also considered. But at that time it implied slower read,
> it was buggy and not even available in the Java API of RocksDB. All of these
> problems were solved since that time (see also RocksDB [blog article for
> deleteRange|https://rocksdb.org/blog/2018/11/21/delete-range.html])
> Delete range enables to clear {{RocksDBMapState}} for one key in constant
> computational complexity whereas the old solution requires O(n ).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)