Have you tried appending '... LIMIT <count> [OFFSET <skip>]' to constrain the per-query result set to a reasonable size?