Skip to main content
Log in

On the complexity of deciding typability in the relational algebra

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract.

We investigate the complexity of the typability problem for the relational algebra. This problem consists of deciding, for a given relational algebra expression, whether there exists an assignment of types to variables occurring in the expression such that the expression is well-typed under the assignment. We obtain that the problem is NP-complete in general. In particular, we show that the problem becomes NP-hard due to (1) the cartesian product operator, (2) the selection operator on arbitrary sets of typed predicates, (3) the selection operator on “well-behaved” sets of typed predicates together with join and projection or renaming. However, the problem is in P when (1) we only allow union, difference, join and selection on “well-behaved” sets of typed predicates, or (2) we allow all operators except cartesian product, where the set of selection predicates can mention at most one base type. Most of these results follow from a close connection of the typability problem to non-uniform constraint satisfaction.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abiteboul, S., Hull, R., Vianu, V. (1995) Foundations of databases. Addison-Wesley

  2. Date, C.J. (1995) An introduction to database systems, 6th edn. Addison-Wesley

  3. Garey, M.R., Johnson, D.S. (1979) Computer and intractability, a guide to the theory of NP-completeness. Freeman

  4. Ohori, A., Buneman, P. (1988) Type inference in a database programming language. Proceedings of the 1988 ACM conference on LISP and functional programming. ACM Press

  5. Pierce, B.C. (2002) Types and programming languages. MIT Press

  6. Schaefer, T.J. (1978) The complexity of satisfiability problems. Proceedings of the tenth annual ACM symposium on Theory of computing, pp. 216-226. ACM Press

  7. Van den Bussche, J., Waller, E. (2002) Polymorphic type inference for the relational algebra. J. Comput. System Sciences 64: 694-718

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Stijn Vansummeren.

Additional information

Received: 18 February 2004, Published online: 14 March 2005

Stijn Vansummeren: Research Assistant of the Fund for Scientific Research - Flanders (Belgium)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Vansummeren, S. On the complexity of deciding typability in the relational algebra. Acta Informatica 41, 367–381 (2005). https://doi.org/10.1007/s00236-005-0162-6

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-005-0162-6

Keywords

Navigation