1. A method for running a query on a database table, said table comprising a column of values and including for each of a plurality of substrings, a corresponding index over the column, wherein each corresponding index includes a respective entry for each value in the column, the respective entry for a particular value being indicative of whether the corresponding substring occurs in that particular value, and the respective entry for the particular value being indicative of a number of occurrences of the corresponding substring in the particular value, the method comprising the steps of: using at least one hardware-implemented processor, identifying a set of values that potentially satisfy the query based on the plurality of corresponding indices, including using the index corresponding to a substring identified in the query to determine a number of occurrences of the substring in each value among the set of values.