Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1375696.1375706acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Resource bound analysis for database queries

Published: 07 June 2008 Publication History

Abstract

Many scientific disciplines, such as biology and astronomy, are now collecting large amounts of raw data systematically and storing it centrally in relational databases for shared use by their communities. In many cases such systems accept arbitrary SQL queries submitted using a Web form. Typical database management systems do not provide support for enforcing resource access control policies to guard against expensive or pointless queries submitted accidentally by legitimate users or intentionally by attackers. Instead, such systems typically employ timeouts to halt queries that do not terminate within a reasonable period of time. This approach can limit misuse but cannot prevent it; moreover, it does not provide useful feedback for legitimate users whose queries exceed the time limit.
In this paper, we study a language-based technique for bounding the time and space resource usage of database queries. We introduce a cost semantics for a simple core database query language, define a type-based analysis for estimating an upper bound on the asymptotic running time of a query, and prove its soundness. We also discuss a prototype implementation which we have used to analyze typical SQL queries submitted to the SDSS SkyServer astronomical database.

References

[1]
Andreas Abel. Semi-continuous sized types and termination. In Zoltán Ésik, editor, CSL, volume 4207 of LNCS, pages 72--88. Springer, 2006.
[2]
Peter Buneman, Shamim A. Naqvi, Val Tannen, and Limsoon Wong. Principles of programming with complex objects and collection types. Theor. Comp. Sci., 149(1):3--48, 1995.
[3]
Ajay Chander, David Espinosa, Nayeem Islam, Peter Lee, and George C. Necula. Enforcing resource bounds via static verification of dynamic checks. ACM Trans. Program. Lang. Syst., 29(5):28, 2007.
[4]
Karl Crary and Stephnie Weirich. Resource bound certification. In POPL, pages 184--198, New York, NY, USA, 2000. ACM.
[5]
Deepak Goyal and Robert Paige. The formal reconstruction and speedup of the linear time fragment of Willard's relational calculus subset. In Algorithmic Languages and Calculi, pages 382--414, 1997.
[6]
Martin Hofmann and Steffen Jost. Static prediction of heap space usage for first-order functional programs. In POPL, pages 185--197, 2003.
[7]
John Hughes, Lars Pareto, and Amr Sabry. Proving the correctness of reactive systems using sized types. In POPL, pages 410--423, New York, NY, USA, 1996. ACM.
[8]
Simon Peyton Jones and Philip Wadler. Comprehensive comprehensions. In Haskell Workshop, pages 61--72, New York, NY, USA, 2007. ACM.
[9]
Philip M. Lewis, Arthur Bernstein, and Michael Kifer. Databases and Transaction Processing.
[10]
R. G. Mann and R. Williams. What is the virtual observatory? Available from www.roe.ac.uk/ rgm/sc4devo/WhatIsTheVO.pdf, 2004.
[11]
D. Le Metayer. Mechanical analysis of program complexity. In Proceedings of the 1985 symposium on language issues in programming environments, pages 69--73, New York, NY, USA, 1985. ACM.
[12]
Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. Principles of Program Analysis. Springer, second edition, 2005.
[13]
Gultekin Ozsoyoglu and Richard Thomas Snodgrass. Temporal and real-time databases: A survey. IEEE Trans. on Knowl. and Data Eng., 7(4):513--532, 1995.
[14]
Raghu Ramakrishnan and Johannes Gehrke. Database Management Systems. McGraw-Hill, 2002).
[15]
Mads Rosendahl. Automatic complexity analysis. In FPCA, pages 144--156, New York, NY, USA, 1989. ACM.
[16]
D. Sands. Complexity analysis for a lazy higher-order language. In ESOP, pages 361--376, New York, NY, USA, 1990. Springer-Verlag New York, Inc.
[17]
Patrick M. Sansom and Simon L. Peyton Jones. Formally based profiling for higher-order functional languages. ACMTrans. Program. Lang. Syst., 19(2):334--385, 1997.
[18]
Daniel Spoonhower. Cost semantics for space usage in a parallel language. In Proceedings of the 2007 workshop on declarative aspects of multicore programming (DAMP), pages 34--36, New York, NY, USA, 2007. ACM.
[19]
Philip Wadler. Comprehending monads. Mathematical Structures in Computer Science, 2:461--493, 1992.
[20]
Ben Wegbreit. Mechanical program analysis. Commun. ACM, 18(9):528--539, 1975.
[21]
Dan E. Willard. Quasilinear algorithms for processing relational calculus expressions (preliminary report). In PODS, pages 243--257, New York, NY, USA, 1990. ACM.
[22]
H. Xi. Dependent types for program termination verification. LISP and Symbolic Computation, 15(1), 2002.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLAS '08: Proceedings of the third ACM SIGPLAN workshop on Programming languages and analysis for security
June 2008
154 pages
ISBN:9781595939364
DOI:10.1145/1375696
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 June 2008

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. databases
  2. query languages
  3. resource bounds

Qualifiers

  • Research-article

Conference

PLDI '08
Sponsor:

Acceptance Rates

Overall Acceptance Rate 43 of 77 submissions, 56%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 192
    Total Downloads
  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media