n*****g 发帖数: 274 | 1 1. primary key vs index
2. 1M 7 digit phone numbers, 2MB spare memory, read each number only once
and sort them.
3. you need read a lot of records, you don't know how many records here
before you complete it. After you read all those records, you need select
one record randomly.In another words, every record has same chance to be
selected. The memory is limited, that means you cannot store all those
records at one time. |
|