LIKE Patterns and Complexity

  • Holger Petersen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11653)


We investigate the expressive power and complexity questions for the LIKE operator in SQL. The languages definable by a single LIKE pattern and generalizations are related to a well-known hierarchy of classes of formal languages, namely the dot-depth hierarchy introduced by Cohen and Brzozowski. Then we turn to natural decision problems and show that membership is likely easier for LIKE patterns than for more powerful regular expressions. Equivalence is provably harder for general regular expressions. More complex conditions based on LIKE patterns are also considered.



Many thanks to Manfred Kufleitner for information about star-free languages.


  1. 1.
    Oracle\(^{{\textregistered }}\) Database SQL Reference 10g Release 1.
  2. 2.
    Aho, A.V.: Algorithms for finding patterns in strings. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science. Algorithms and Complexity, vol. A, pp. 255–300. MIT Press, Cambridge (1990)Google Scholar
  3. 3.
    Brzozowski, J.A., Knast, R.: The dot-depth hierarchy of star-free languages is infinite. JCSS 16, 37–55 (1978)MathSciNetzbMATHGoogle Scholar
  4. 4.
    Benedikt, M., Libkin, L., Schwentick, T., Segoufin, L.: String operations in query languages. In: Buneman, P. (ed.) Proceedings of the Twentieth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, Santa Barbara, California, USA, 21–23 May 2001, pp. 183–194 (2001)Google Scholar
  5. 5.
    Cohen, R.S., Brzozowski, J.A.: Dot-depth of star-free events. JCSS 5, 1–16 (1971)MathSciNetzbMATHGoogle Scholar
  6. 6.
    Freydenberger, D.D.: Extended regular expressions: succinctness and decidability. In: Schwentick, T., Dürr, C. (eds.) Proceedings of the 28th Annual Symposium on Theoretical Aspects of Computer Science (STACS 2011), Leibniz International Proceedings in Informatics, pp. 507–518. Schloss Dagstuhl: Leibniz-Zentrum für Informatik. Dagstuhl Publishing, Germany (2011)Google Scholar
  7. 7.
    Fürer, M.: Nicht-elementare untere Schranken in der Automaten-Theorie. Ph.D. thesis, ETH Zürich (1978)Google Scholar
  8. 8.
    Furst, M., Saxe, J.B., Sipser, M.: Parity, circuits, and the polynomial-time hierarchy. Math. Syst. Theory 17, 13–27 (1984)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Jiang, T., Ravikumar, B.: A note on the space complexity of some decision problems for finite automata. Inf. Process. Lett. 40, 25–31 (1991)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Lynch, N.: Log space recognition and translation of parenthesis languages. J. Assoc. Comput. Mach. 24, 583–590 (1977) MathSciNetCrossRefGoogle Scholar
  11. 11.
    Meyer, A.R., Stockmeyer, L.J.: The equivalence problem for regular expressions with squaring requires exponential space. In: Proceedings of the 13th Annual IEEE Symposium on Switching and Automata Theory, College Park (Maryland), pp. 125–129 (1972)Google Scholar
  12. 12.
    Petersen, H.: Decision problems for generalized regular expressions. In: Proceedings of the 2nd International Workshop on Descriptional Complexity of Automata, Grammars and Related Structures, London (Ontario), pp. 22–29 (2000)Google Scholar
  13. 13.
    Sipser, M.: Introduction to the Theory of Computation, 2nd edn. Thomson, Boston (2006)zbMATHGoogle Scholar
  14. 14.
    Stockmeyer, L.J., Meyer, A.R.: Word problems requiring exponential time. In: Proceedings of the 5th ACM Symposium on Theory of Computing (STOC 1973), Austin (Texas), pp. 1–9 (1973)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Holger Petersen
    • 1
  1. 1.StuttgartGermany

Personalised recommendations