Implements query-time record compilation.