当前位置:网站首页>Kudu design tablet
Kudu design tablet
2022-07-26 17:31:00 【InfoQ】
1. Logical composition

- When the primary key is a single column primary key ,"rowid" In fact, it is built into the storage of primary key columns cfile in , The primary key is stored by sorting , Therefore, each primary key corresponds to one by default "rowid", Get through the primary key "rowid", Then from other cfile Quickly locate other columns , This is what we callprimary key.
- When the primary key is a composite primary key , There will be a separate index file (index cfile) Save the encoded composite primary key , In this way, you can provide the same functions as a single primary key .

2. Reading and writing process
2.1 The data is in MemRowSet Reading and writing in

- If tx<tx1, Express tx1 It hasn't been submitted yet , This row of data will be skipped
- Otherwise, it will tx1 Row data at copy To scanner The buffer , Then traverse mutation Linked list , Find all timestamps less than tx( Indicates that it occurs before the query ) Of mutation And buffer Merge the row data in .
2.2 The data is in DiskRowSet Reading and writing in
2.2.1 The update process :
- According to the primary key, combined with metadata and bloom filter, quickly locate the row record DiskRowSet
- Find the primary key index (index cfile) To determine the line rowid
- then mutation Will enter DeltaMemStore, then DeltaMemStore Will brush the disk to form DeltaFile, therefore DeltaMemStore and DeltaFile The contents are the same , But the latter is more compact after serialization , these DeltaFile Be called REDO files, And inside mutations It's called REDO records
2.2.2 Reading process :
- When you want to MemRowSet When reading the latest version of data immediately after refresh , Just scan Base data that will do
- If you want to backtrack the history , Then read it first base data, Then according to the timestamp of the current scanner, a series of UNDO records And base data Merge and restore the state of history .
- After a period of data falling off the disk , The data may have changed , So there will be DeltaFiles, The scanning at this time is in addition to reading base data outside , Also need to REDO records Merge to get a new version of data
3. RowSet Internal Delta compaction
3.1 Minor REDO delta compaction

3.2 Major REDO delta compaction

4. RowSet Between Merging compactions
- Random access ( Or update according to the primary key ), because RowSet The key ranges of may overlap , So you need to query all RowSet Key range to determine what the specified key may exist RowSet, adopt bloom filter Can effectively filter some RowSet And reduce physical scanning , But the extra pair bloom filter Access to will also increase memory and cpu Consumption of
- Range scan , In this case , With overlapping key ranges RowSet All need to be scanned ,bloom filter It cannot be filtered as effectively as random access .
- Sort scan , From each RowSet After scanning the target data , You need to RowSet The scanning results are summarized, merged and sorted ,RowSet The more , This process will consume more performance .
边栏推荐
- Pytest (mind map)
- Interface comparator
- What kind of product is the Jetson nano? (how about the performance of Jetson nano)
- Shrimp Shope get commodity details according to ID API return value description
- Implement softmax classification from zero sum using mxnet
- What is a test case? How to design?
- Environment setup mongodb
- UPC 2022 summer personal training game 07 (part)
- leetcode:1206. 设计跳表【跳表板子】
- 敏捷开发与DevOps的对比
猜你喜欢

敏捷开发与DevOps的对比

Pass-19,20
![[ctfshow-web]反序列化](/img/cd/b76e148adfc4d61049ab2cf429d4d7.png)
[ctfshow-web]反序列化

The user experience center of Analysys Qianfan bank was established to help upgrade the user experience of the banking industry

Are CRM and ERP the same thing? What's the difference?

2019 popularization group summary

Anaconda download and Spyder error reporting solution
2.1.2 同步始终失败

Redis persistence - detailed analysis of RDB source code | nanny level analysis! The most complete network

Realizing DDD based on ABP -- related concepts of DDD
随机推荐
Pytest (mind map)
TD database syntax
SQL injection (mind map)
【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测
Methods of path related comments (I)
徽商期货网上开户安全吗?开户办理流程是怎样的?
Advantages of time series database and traditional database
GAN (Generative Adversarial Network,GAN)生成式对抗网络
[Development Tutorial 9] crazy shell arm function mobile phone-i2c tutorial
Data preprocessing of machine learning
How to use align regexp to align userscript meta information
Alibaba cloud Toolkit - project one click deployment tool
[development tutorial 8] crazy shell · open source Bluetooth heart rate waterproof sports Bracelet - triaxial meter pace
[ctfshow web] deserialization
[C language classic topic exercise 2]
第16周OJ实践1 计算该日在本年中是第几天
What are the popular technologies in 2022?
MySQL foundation - basic database operation
2 - configuration and use of routes
My meeting of OA project (meeting seating & submission for approval)




