Duplicated columns when index already has primary-keys columns

18 views
Skip to first unread message

ddorian43

unread,
May 3, 2018, 6:50:19 AM5/3/18
to TiDB user group
Hi,

So, assuming we have a table with `primary_key(a,b)`, and we create an `index(b,a)`.
Is the end index in key-value stored as `idx/b/a/a/b` or `idx/b/a` ?

Meaning, you already store the primary-key columns, so do you repeat them again or tidb is smart enough to not repeat them ?

Regards

Ewan Chou

unread,
May 3, 2018, 2:15:34 PM5/3/18
to TiDB user group
Hi,
They are two separate indices, the primary key is `a/b`, the other one is `b/a`.
Reply all
Reply to author
Forward
0 new messages