Loading queries in memory