GH-30 optimize the query speed