1. A system for selecting a set of n-grams for indexing string data in a database management system (DBMS) in relation to resources available to the DBMS, comprising: a processor configured to: provide a set of candidate n-grams, each n-gram comprising a sequence of characters; receive an n-gram space constraint to define an amount “k” of the set of candidate n-grams eligible for a minimal set of n-grams, the n-gram space constraint based on resources available to the DBMS; compare each of the candidate n-grams from the provided set of candidate n-grams with sample queries and database records to determine a benefit associated with the candidate n-grams in reducing false hits; select the minimal set of n-grams, the minimal set of n-grams having a highest total benefit and being subject to the n-gram space constraint; select an updated minimal set of n-grams responsive to receiving an updated n-gram space constraint, the updated minimal set of n-grams having a highest total benefit and being subject to the updated n-gram space constraint, wherein the updated minimal set of n-grams consists of no more than “k” n-grams; and generate an index, based on the minimal set of selected n-grams or the updated minimal set of n-grams, that indexes string data contained in the database records.