Povio Interview Question

How to optimize some queries?