Testing queries for matrix construction.