From Dimensionality Reduction to Query Hardness Measurement: A Deep Dive into Approximate Nearest Neighbor Search