Improving compiler to support all queries