【24h】

Rewriting Procedures for Batched Bindings

机译:批处理绑定的重写过程

获取原文

摘要

Queries, or calls to stored procedures/user-defined functions are often invoked multiple times, either from within a loop in an application program, or from the where/select clause of an outer query. When the invoked query/procedure/function involves database access, a naive implementation can result in very poor performance, due to random I/O. Query decor-relation addresses this problem in the special case of nested sub-queries, but is not applicable otherwise. This problem is traditionally addressed by manually rewriting the application to make it set-oriented, by creating a batch of parameters, and by rewriting the query/procedure to work on the batch instead of one parameter at a time. Such manual rewriting is time-consuming and error prone.In this paper, we propose techniques that can be used to do the following. (a) Automatically rewrite programs to replace multiple calls to a query by a batched call to a correspondingly rewritten query. (b) Rewrite a stored procedure/function to accept a batch of bindings, instead of a single binding. Thereby, for example, a query which would have been invoked many times from different invocations of a stored procedure would be automatically replaced by one (or a few) invocations of a batched version of the query.Our techniques can be applied to code written in any language, such as procedural versions of SQL, or Java. We have implemented the proposed rewriting techniques for a subset of Java, where database operations are performed using an API over JDBC. We demonstrate the benefits due to our rewrites with three cases from real-world applications, which faced significant performance problems due to repeated invocations of queries/procedures.
机译:查询或对存储过程/用户定义函数的调用通常是从应用程序的循环内或从外部查询的where / select子句多次调用。当调用的查询/过程/函数涉及数据库访问时,由于随机I / O,单纯的实现可能会导致性能很差。查询修饰关系在嵌套子查询的特殊情况下解决了此问题,但不适用于其他情况。传统上,通过手动重写应用程序以使其面向集合,创建一批参数以及重写查询/过程以一次处理一个批次而不是一个参数来解决此问题。这种手动重写既费时又容易出错。 在本文中,我们提出了可用于执行以下操作的技术。 (a)自动重写程序,以对相应重写的查询的批处理调用替换对某个查询的多个调用。 (b)重写存储过程/函数以接受一批绑定,而不是单个绑定。因此,例如,本来可以从存储过程的不同调用中多次调用的查询将自动由该批处理版本的一次(或几次)调用替换。 我们的技术可以应用于以任何语言编写的代码,例如SQL或Java的过程版本。我们已经为Java的子集实现了建议的重写技术,其中使用基于JDBC的API来执行数据库操作。我们通过重写真实应用程序中的三种情况来展示由于重写而带来的好处,这些情况由于重复调用查询/过程而面临严重的性能问题。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号