query ap_rep