query for key (indexes) exists on a table