improvements on pd map query