Repaired queryDB