Writing Fast Queries in APEX