diff --git a/be/src/olap/primary_key_index.h b/be/src/olap/primary_key_index.h index 2362a1f784ea22..5645ba3c21baf2 100644 --- a/be/src/olap/primary_key_index.h +++ b/be/src/olap/primary_key_index.h @@ -34,6 +34,8 @@ namespace doris { // The primary key index is designed in a similar way like RocksDB // Partitioned Index, which is created in the segment file when MemTable flushes. // Index is stored in multiple pages to leverage the IndexedColumnWriter. +// +// NOTE: for now, it's only used when unique key merge-on-write property enabled. class PrimaryKeyIndexBuilder { public: PrimaryKeyIndexBuilder(io::FileWriter* file_writer) diff --git a/be/src/olap/tablet_meta.h b/be/src/olap/tablet_meta.h index e32b966d1f5323..60713fa9779f27 100644 --- a/be/src/olap/tablet_meta.h +++ b/be/src/olap/tablet_meta.h @@ -240,7 +240,10 @@ class TabletMeta { // FIXME(cyx): Currently `cooldown_resource` is equivalent to `storage_policy`. io::ResourceId _cooldown_resource; - // may be true iff unique keys model. + // For unique key data model, the feature Merge-on-Write will leverage a primary + // key index and a delete-bitmap to mark duplicate keys as deleted in load stage, + // which can avoid the merging cost in read stage, and accelerate the aggregation + // query performance significantly. bool _enable_unique_key_merge_on_write = false; std::unique_ptr _delete_bitmap; @@ -249,7 +252,8 @@ class TabletMeta { /** * Wraps multiple bitmaps for recording rows (row id) that are deleted or - * overwritten. + * overwritten. For now, it's only used when unique key merge-on-write property + * enabled. * * RowsetId and SegmentId are for locating segment, Version here is a single * uint32_t means that at which "version" of the load causes the delete or diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java index 84f81703168551..76df8ad09dc7b8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java @@ -118,6 +118,12 @@ public class PropertyAnalyzer { private static final double MAX_FPP = 0.05; private static final double MIN_FPP = 0.0001; + // For unique key data model, the feature Merge-on-Write will leverage a primary + // key index and a delete-bitmap to mark duplicate keys as deleted in load stage, + // which can avoid the merging cost in read stage, and accelerate the aggregation + // query performance significantly. + // For the detail design, see the [DISP-018](https://cwiki.apache.org/confluence/ + // display/DORIS/DSIP-018%3A+Support+Merge-On-Write+implementation+for+UNIQUE+KEY+data+model) public static final String ENABLE_UNIQUE_KEY_MERGE_ON_WRITE = "enable_unique_key_merge_on_write"; /**