query indexes from SQL