The VLDB Journal

, Volume 25, Issue 5, pp 719–740

GPU-accelerated string matching for database applications

Special Issue Paper

DOI: 10.1007/s00778-015-0409-y

Cite this article as:
Sitaridi, E.A. & Ross, K.A. The VLDB Journal (2016) 25: 719. doi:10.1007/s00778-015-0409-y


Implementations of relational operators on GPU processors have resulted in order of magnitude speedups compared to their multicore CPU counterparts. Here we focus on the efficient implementation of string matching operators common in SQL queries. Due to different architectural features the optimal algorithm for CPUs might be suboptimal for GPUs. GPUs achieve high memory bandwidth by running thousands of threads, so it is not feasible to keep the working set of all threads in the cache in a naive implementation. In GPUs the unit of execution is a group of threads and in the presence of loops and branches, threads in a group have to follow the same execution path; if some threads diverge, then different paths are serialized. We study the cache memory efficiency of single- and multi-pattern string matching algorithms for conventional and pivoted string layouts in the GPU memory. We evaluate the memory efficiency in terms of memory access pattern and achieved memory bandwidth for different parallelization methods. To reduce thread divergence, we split string matching into multiple steps. We evaluate the different matching algorithms in terms of average- and worst-case performance and compare them against state-of-the-art CPU and GPU libraries. Our experimental evaluation shows that thread and memory efficiency affect performance significantly and that our proposed methods outperform previous CPU and GPU algorithms in terms of raw performance and power efficiency. The Knuth–Morris–Pratt algorithm is a good choice for GPUs because its regular memory access pattern makes it amenable to several GPU optimizations.


Text queries String matching GPU Processing Thread divergence Cache efficiency 

Funding information

Funder NameGrant NumberFunding Note
National Science Foundation
  • IIS-1218222
IBM PhD Fellowship
    Alexander S. Onassis Public Benefit Foundation

      Copyright information

      © Springer-Verlag Berlin Heidelberg 2015

      Authors and Affiliations

      1. 1.Department of Computer ScienceColumbia UniversityNew YorkUSA

      Personalised recommendations