You should limit the result set sent to client and try to use stored procedure to do most of the work on database server.