Issue #49 - Calculating the query indexes