Adding query using global index