OpenMLDB icon indicating copy to clipboard operation
OpenMLDB copied to clipboard

disk table supports duplicate key?

Open zhanghaohit opened this issue 2 years ago • 0 comments

Describe the feature you'd like

One big difference between disk table and mem table is that disk table only allows one unique key per index. For example, if the index is <col1, col2>. the rows we inserted are:

id col1 col2
1 k1 1
2 k1 1
3 k2 1
4 k2 2

In mem table, it will be:

id col1 col2
1 k1 1
2 k1 1
3 k2 1
4 k2 2

However, in disk table, it will be:

id col1 col2
1 k1 1
3 k2 1
4 k2 2

because row 1 and row 2 have the same value of <col1, col2>.

We should discuss whether we should support the same semantics for both disk table and memory table.

Additional context One possible solution is to add a sequence number to the combined key for disk table.

zhanghaohit avatar Aug 08 '22 09:08 zhanghaohit