13 | | Explain what is primary and secondary index. |
| 13 | indexing with another field which is not primary key. |
| 14 | |
| 15 | 內容與原本table 相似的另一張table,但key 不同,利於排列內容 |
| 16 | |
| 17 | 如: table1 (primary) |
| 18 | || || '''name''' || '''price''' || '''description''' || |
| 19 | || 1 || apple || 10 || xxx || |
| 20 | || 2 || orig || 5 || ooo || |
| 21 | || 3 || banana || 15 || vvvv || |
| 22 | || 4 || tomato || 8 || uuuu || |
| 23 | |
| 24 | 使用者想依售價做排序,則可以建立 secondary index table |
| 25 | || '''price''' || '''name''' || '''description''' || |
| 26 | || 5 || orig || ooo || |
| 27 | || 8 || tomato || uuuu || |
| 28 | || 10 || apple || xxx || |
| 29 | || 15 || banana || vvvv || |
| 30 | |
| 31 | |
| 32 | == Explain what is primary and secondary index == |