arXiv:2608.23307cs.DBAug 2026

Manuscript Offprint

arXiv:2608.23307

Teach Your DBMS to LIKE Strings: Fast and General Pattern Matching for Wildcard Joins and Filters

Lam-Duy Nguyen, Pascal Ginter, Duc-Tam Nguyen, Thomas Neumann, Viktor Leis

Lam-Duy Nguyen

lamduy.nguyen@tum.de

Technische Universität München

Germany

Pascal Ginter

pascal.ginter@tum.de

Technische Universität München

Germany

Duc-Tam Nguyen

tamnd@liteio.dev

LiteIO

Vietnam

Thomas Neumann

neumann@in.tum.de

Technische Universität München

Germany

ABSTRACT

Nowadays, modern applications do more than just store text – they need to derive meaningful insights from it. To do that, they usually rely on wildcard queries with LIKE predicate to extract patterns. However, modern database management systems (DBMSs) handle these wildcard operations poorly, resorting to nested loops for joins and expensive interpreted evaluation for filters. To address the former, we propose a new join algorithm based on the Aho-Corasick algorithm, which significantly reduces the time complexity. For wildcard filtering, we leverage the code-generation infrastructure to improve performance: we generate specialized code for the LIKE predicate, eliminating the overhead of interpreting the pattern per tuple. Our experimental results show that the new wildcard join algorithm significantly outperforms both baseline DuckDB and Umbra, achieving speedups of up to 30.6×30.6\times and 114.75×114.75\times, respectively. The new wildcard filter approach likewise outperforms both baselines, achieving 13.3×13.3\times speedups in a filter-focused stress benchmark. We believe these two techniques will play key roles for high-performance text analytics in modern query engines.

PVLDB Reference Format:

Lam-Duy Nguyen, Pascal Ginter, Duc-Tam Nguyen, Thomas Neumann, and Viktor Leis. Teach Your DBMS to LIKE Strings: Fast and General Pattern Matching for Wildcard Joins and Filters. PVLDB, 20(1): XXX-XXX, 2027.

doi:XX.XX/XXX.XX

PVLDB Artifact Availability:

The source code, data, and/or other artifacts have been made available at https://github.com/lamduynguyen/wildcard-join.

1 INTRODUCTION

The ubiquity of string data. Modern applications heavily rely on strings as the catch-all data type for heterogeneous data. For example, in e-commerce platforms like Amazon, a product profile comprises a complex mix of string-based attributes, including Viktor Leis

leis@in.tum.de

Technische Universität München

Germany

Heterogeneous data

Product IDs, descriptions.

Target customers, reviews, ...

Example:

Product ID: B07PY42BRC

Review: This BrandA camera is

better than BrandD

Filter:

WHERE Product Desc

LIKE "%smart%"

Business

analysis

Join: UserReviews u JOIN

BrandDictionary b ON

u.review LIKE '%' ||

b.name || '%'

Figure

Figure 1: Deriving insights from text requires extensive pattern matching, which is typically performed using wildcard queries. However, modern DBMSs fail to execute them efficiently due to a lack of specialized execution strategies.

descriptions, related product links, user reviews, and many more. Even machine-generated data – such as Amazon Standard Identification Numbers (ASINs), email addresses, and system logs – is predominantly stored and processed as strings.

The demand for text-heavy analysis. To unlock hidden business value within these strings, modern applications require complex text analytics. For example, an e-commerce platform might analyze its text data to answer questions like:

(1) How often, and in what context, do users mention specific brands within their written reviews?

(2) How well do appliances claiming to be "smart" or "IoT" actually integrate with existing smart home ecosystems according to user feedback?

(3) When customers purchase a competitor's product, how often do they mention a rival brand in their review to make a direct comparison?

This work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of this license. For any use beyond those covered by this license, obtain permission by emailing info@vldb.org. Copyright is held by the owner/author(s). Publication rights licensed to the VLDB Endowment.

Proceedings of the VLDB Endowment, Vol. 20, No. 1 ISSN 2150-8097. doi:XX.XX/XXX.XX

Primitives behind text analytics: Wildcards. To perform these analyses, DBMSs rely heavily on string pattern matching. In relational databases, this is often expressed using the SQL LIKE expression (e.g., WHERE review LIKE "%smart%"), as shown in Figure 1. Two main operators associated with LIKE predicate: wildcard filters that scan text fields for a single, specific phrase (e.g., finding items containing "smart" – question (2)), and wildcard joins that match text data against a large set of target patterns, such as checking a review table against a dictionary of thousands of brand names (i.e., question (1) and (3) above).

Suboptimal wildcard processing in DBMSs. Despite their necessity, DBMSs handle wildcard operations poorly, mainly because they lack specialized physical operators. Consequently, current engines rely on computationally expensive execution strategies: They default to high-overhead interpreted evaluation for LIKE filters, and inefficient nested-loop execution for joins. On large datasets, these suboptimal execution strategies make complex text analytics computationally expensive.

Contributions. Motivated by the lack of research on database string processing highlighted in Mühleisen’s CIDR keynote [48], this work addresses the optimization gap for wildcard operations. Specifically, we make the following contributions:

• Efficient wildcard joins: We propose a novel execution strategy based on the Aho-Corasick algorithm [18], eliminating the expensive combination of nested-loop join structure and standard LIKE evaluations. The key innovation lies in the concept of positional constraints – how two wildcard metacharacters '%' and '_' enforce space requirements between pattern literals. Exploiting this concept, our design significantly reduces complexity, outperforming baseline approaches by up to 114.75×114.75\times in our evaluation.

• Compiled wildcard filters: We exploit code compilation architectures to generate specialized code for LIKE predicate evaluation. By embedding the pattern as compile-time constants and specializing the evaluation logic, our approach reduces per-tuple runtime overhead and avoids repeated memory accesses to the pattern. Our approach outperforms other baselines by at least 13.3×13.3\times in a filter-focused stress experiment.

Outline. The remainder of this paper is organized as follows. Section 2 provides the necessary background on the LIKE predicate and its associated wildcard operations. Section 3 details our novel execution strategy for wildcard joins. Section 4 describes our compilation-based LIKE predicate evaluation method. Section 5 empirically evaluates the performance of both proposed techniques. Finally, Section 6 reviews related literature, and Section 7 concludes the paper.