content_image/834473.jpg content_image/834477.jpg
<img src='content_image/834473.jpg'>

For the PRIMARY  index, there are two n_diff%  rows. The number of rows is equal to the number of columns in the index. 

<img src='content_image/834477.jpg'>

## Note 

For nonunique indexes, InnoDB  appends the columns of the primary key. 

•Where index_name = PRIMARY  and stat_name = n_diff_pfx01 , the stat_value  is 1 , which indicates that there is a single distinct value in the first column of the index (column a ). The number of distinct values in column a  is confirmed by viewing the data in column a  in table t1 , in which there is a single distinct value ( 1 ). The counted column ( a ) is shown in the stat_description  column of the result set. 

•Where index_name = PRIMARY  and stat_name = n_diff_pfx02 , the stat_value  is 5 , which indicates that there are five distinct values in the two columns of the index ( a,b ). The number of distinct values in columns a  and b  is confirmed by viewing the data in columns a  and b  in table t1 , in which there are five distinct values: ( 1,1 ), ( 1,2 ), ( 1,3 ), ( 1,4 ) and ( 1,5 ). The counted columns ( a,b ) are shown in the stat_description  column of the result set. 

For the secondary index ( i1 ), there are four n_diff%  rows. Only two columns are defined for the secondary index ( c,d ) but there are four n_diff%  rows for the secondary index because InnoDB  suffixes all nonunique indexes with the primary key. As a result, there are four n_diff%  rows instead of two to account for the both the secondary index columns ( c,d ) and the primary key columns ( a,b ). 

•Where index_name = i1  and stat_name = n_diff_pfx01 , the stat_value  is 1 , which indicates that there is a single distinct value in the first column of the index (column c ). The number of distinct values in column c  is confirmed by viewing the data in column c  in table t1 , in which there is a single distinct value: ( 10 ). The counted column ( c ) is shown in the stat_description  column of the result set. 

•Where index_name = i1  and stat_name = n_diff_pfx02 , the stat_value  is 2 , which indicates that there are two distinct values in the first two columns of the index ( c,d ). The number of distinct values in columns c  an d  is confirmed by viewing the data in columns c  and d  in table t1 , in which there are two distinct values: ( 10,11 ) and ( 10,12 ). The counted columns ( c,d ) are shown in the stat_description  column of the result set. 

•Where index_name = i1  and stat_name = n_diff_pfx03 , the stat_value  is 2 , which indicates that there are two distinct values in the first three columns of the index ( c,d,a ). The number of distinct values in columns c , d , and a  is confirmed by viewing the data in column c , d , and a  in table t1 , in which there are two distinct values: ( 10,11,1 ) and ( 10,12,1 ). The counted columns ( c,d,a ) are shown in the stat_description  column of the result set. 

•Where index_name = i1  and stat_name = n_diff_pfx04 , the stat_value  is 5 , which indicates that there are five distinct values in the four columns of the index ( c,d,a,b ). The number of distinct values in columns c , d , a  and b  is confirmed by viewing the data in columns c , d , a , and b  in table t1 , 

