# Query `(SELECT)` a Row from a Table with Non-Clustered Index for Primary Key

![`smart`](NonClusteredPrimaryKeyTableSELECT01_aa_002_20230905.png)

```7
tidb> DESC t_nonclustered;
+-------+-------------+------+------+---------+-------+
| Field | Type        | Null | Key  | Default | Extra |
+-------+-------------+------+------+---------+-------+
| id    | int(11)     | NO   | PRI  | NULL    |       |
| name  | varchar(20) | YES  |      | NULL    |       |
| tel   | varchar(16) | YES  |      | NULL    |       |
+-------+-------------+------+------+---------+-------+

tidb> SELECT TABLE_NAME, TIDB_PK_TYPE FROM information_schema.tables 
  WHERE table_schema = 'test' AND table_name in ('t_nonclustered');
+----------------+--------------+
| TABLE_NAME     | TIDB_PK_TYPE |
+----------------+--------------+
| t_nonclustered | ~!@NONCLUSTERED@!~ |
+----------------+--------------+

tidb> SELECT _tidb_rowid, id, name, tel FROM t_nonclustered
  ORDER BY _tidb_rowid;
+-------------+----+-------+------------+
| ~!@_tidb_rowid@!~ | id | name  | tel        |
+-------------+----+-------+-------------+
|           1 |  1 | Tom   | 7073958726  |
|           2 |  2 | Jack  | 4782733578  |
|           3 |  3 | Frank | 147810546   |
|           4 |  4 | Tony  | 335451143   |
|           5 |  5 | Jim   | 1390811212  |
|           6 |  6 | Sam   | 1579915611  |
|           7 |  7 | Andy  | 18922118921 |
+-------------+----+-------+-------------+

tidb> EXPLAIN SELECT name, tel FROM t_nonclustered WHERE id = 3;
+-------------+---------+------+-----------------------------------------+---------------+
| id          | estRows | task | access object                           | operator info |
+-------------+---------+------+-----------------------------------------+---------------+
| Point_Get_1 | 1.00    | root | ~!@table:t_nonclustered, index:PRIMARY(id)@!~ |               |
+-------------+---------+------+-----------------------------------------+---------------+
```
------------------------------------------------------------------------------
The slide shows a table `t_nonclustered` with 7 rows, which is a table with non-clustered index for primary key. The primary key is on column `id`.

Database client has issued a `SELECT` statement:
```
SELECT name, tel FROM t_nonclustered WHERE id = 3;
```

Then, three important steps executed by the TiDB server instance in a specific order: 
`1.` The metadata of the `t_nonclustered` table in the `Placement Driver` is retrieved. As a result, the TiDB server instance becomes aware of the TiKV node that contains the desired TiKV Region.
`2.` The primary key index is accessed to retrieve the unique `_tidb_rowid` value, and the access is either for one item or none.
`3.` The table is accessed to retrieve the row of interest by using the unique `_tidb_rowid` value, it is referred to as a `Point_Get` operation.

Note the `operator info` column is empty in the explain table, which indicates that the TiDB server `(Root)` instance is not yet aware of the actual primary in step 2. 