Patent 11016975 was granted and assigned to Snowflake on May, 2021 by the United States Patent and Trademark Office.
A query directed at a source table organized into a set of batch units is received. The query includes a pattern matching predicate that specifies a search pattern. A set of N-grams are generated based on the search pattern. A pruning index is used to identify a subset of batch units to scan for matching data based on the set of N-grams generated for the search pattern. The pruning index indexes distinct N-grams in the source table. The query is processed by scanning the subset of batch units.