I am running the command:
show index from atpco_fare
.atpco_r1_fare_cls
;
And the result is in the table
Table, Non_unique, Key_name, Seq_in_index, Column_name, Collation, Cardinality, Sub_part, Packed, Null, Index_type, Comment, Index_comment, Visible
atpco_r1_fare_cls 0 PRIMARY 1 tar_nbr A 7707 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 2 carr_cd A 46531 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 3 rule_nbr A 426326 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 4 fare_cls A 30087162 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 5 seq_nbr A 21610918 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 6 mcn A 31260526 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 7 eff_date A 31260526 BTREE YES
atpco_r1_fare_cls 0 PRIMARY 8 proc_ind A 31260526 BTREE YES
I do not understand the cardinality of the combined primary key as it does not show fully that with the increase of sequence it should be more unique rather than less. At least, it should not be less, based on my understanding of index.
First question is why is the seq_nbr which is the sequence number has less cardinality. What does it indicate?
Second, why are the last three with the same cardinality? What does it indicate?
SHOW CREATE TABLE
.)