Implemented faster SQL query to search for a user's plans