Skip to content

Commit

Permalink
Add some comments for the feature mow (#11028)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhannngchen authored Jul 20, 2022
1 parent ec5471f commit a1c1cfc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions be/src/olap/primary_key_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions be/src/olap/tablet_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<DeleteBitmap> _delete_bitmap;

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down

0 comments on commit a1c1cfc

Please sign in to comment.