sub query buffer structure