How can one quickly look up people from a large database?
That is problem is call identification, mapping a percept to a specific entity.
One common option is hashing, take a percept and map it to a specific, unique integer. If two different percepts map to the same integer, they are the same entity. If two different percepts do not map to the same integer, they are different entities. Hashing takes constant time to look-up an entity no matter how many entities.
In the case of facial recognition, the hashing function is best learned through Deep Learning.