Query trip: bridge the gap between FE nad BE