PlayStation interview question

How to optimize queries?