mysql> show columns from data_before;
+-----------------+----------------------+------+-----+---------+----------------+
| Field           | Type                 | Null | Key | Default | Extra          |
+-----------------+----------------------+------+-----+---------+----------------+
| ID              | int(11)              | NO   | PRI | NULL    | auto_increment | 
| BCCH            | smallint(5) unsigned | YES  | MUL | NULL    |                | 
..................................................................................
| TA              | tinyint(3) unsigned  | YES  | MUL | NULL    |                |
..................................................................................
+-----------------+----------------------+------+-----+---------+----------------+
38 rows in set (0.02 sec)

mysql> show indexes from data_before;
+-------------+------------+-------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+
| Table       | Non_unique | Key_name          | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------------+------------+-------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+
| data_before |          0 | PRIMARY           |            1 | ID             | A         |       12762 |     NULL | NULL   |      | BTREE      |         | 
| data_before |          1 | idxBCCH           |            1 | BCCH           | A         |       12762 |     NULL | NULL   | YES  | BTREE      |         | 
............................................................................................................................................................
| data_before |          1 | idxTA             |            1 | TA             | A         |       12762 |     NULL | NULL   | YES  | BTREE      |         |
............................................................................................................................................................
+-------------+------------+-------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+
31 rows in set (0.86 sec)

mysql> explain select bcch from data_before;
+----+-------------+-------------+-------+---------------+---------+---------+------+-------+-------------+
| id | select_type | table       | type  | possible_keys | key     | key_len | ref  | rows  | Extra       |
+----+-------------+-------------+-------+---------------+---------+---------+------+-------+-------------+
|  1 | SIMPLE      | data_before | index | NULL          | idxBCCH | 3       | NULL | 12762 | Using index | 
+----+-------------+-------------+-------+---------------+---------+---------+------+-------+-------------+
1 row in set (0.00 sec)

mysql> select bcch from data_before;
+------+
| bcch |
+------+
|   17 | 
........
| 1015 | 
+------+
10291 rows in set (0.05 sec)

mysql> explain select ta from data_before;
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------------+
| id | select_type | table       | type  | possible_keys | key   | key_len | ref  | rows  | Extra       |
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------------+
|  1 | SIMPLE      | data_before | index | NULL          | idxTA | 2       | NULL | 12762 | Using index | 
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------------+
1 row in set (0.00 sec)

mysql> select ta from data_before;
+------+
| ta   |
+------+
|    0 | 
........
|   15 | 
+------+
10291 rows in set (0.00 sec)

mysql> explain select bcch from data_before order by ta;
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------+
| id | select_type | table       | type  | possible_keys | key   | key_len | ref  | rows  | Extra |
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------+
|  1 | SIMPLE      | data_before | index | NULL          | idxTA | 2       | NULL | 12762 |       | 
+----+-------------+-------------+-------+---------------+-------+---------+------+-------+-------+
1 row in set (0.00 sec)

mysql> select bcch from data_before order by ta;
+------+
| bcch |
+------+
|  513 | 
..........
|   47 | 
+------+
10291 rows in set (7.94 sec)


mysql> exit;
