pais join query testing