Common Table Expressions (CTEs), introduced in the SQL Standard 1999, are similar to subroutines in programming languages: they can be referenced from multiple places in a query and may refer to themselves, providing recursive queries. Many RDBMSs implemented this feature, yet not in full. Until recently MariaDB did not have this feature either. This article describes CTE overall and looks through some interesting cases that are implemented in MariaDB only, like non-linear recursion and mutual recursion. It also compares optimizations for non-recursive CTEs across different RDBMSs. Finally, the results of experiments comparing computation of recursive CTEs for MariaDB and PostgreSQL are presented.

Original languageEnglish
JournalCEUR Workshop Proceedings
Volume1864
StatePublished - 1 Jan 2017
Event2nd Conference on Software Engineering and Information Management, SEIM 2017 - Saint Petersburg, Russian Federation
Duration: 21 Apr 2017 → …

    Scopus subject areas

  • Computer Science(all)

    Research areas

  • Common Table Expressions, MariaDB, Optimization

ID: 36627169