# US 2014/0195512 A1 · Method for optimizing performance of database/web-service backed applications by automatically prefetching query results

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0195512 A1
- Document ID: US20140195512A1
- Status: Published application
- Kind: A1
- Application number: 14/149,978
- Filed: 2014-01-08
- Published: 2014-07-10
- Earliest claimed: 2013-01-09
- Assignees: Indian Institute of Technology Bombay
- Applicants: Indian Institute of Technology Bombay
- Inventors: Karthik Ramachandra; Sundararajarao Sudarshan
- Web page: https://patentgrep.com/patent/US20140195512A1

## CPC

- G06F 16/24539: {using cached or materialised query results}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure proposes the method for optimizing the performance of data base/web-service backed applications by automatically prefetching query results. The proposed system and methods automatically insert prefetch instructions at the earliest possible points across procedure calls in application source code, in presence of conditional branching and loops. A data flow analysis technique called anticipable expressions analysis is extended, to analyze anticipability of queries. The benefit of prefetching is limited due to the presence of assignment statements and conditional branches that precede the query execution statement. Enhancements such as code motion, chaining and rewriting prefetch requests are devised to increase benefits of prefetching. These techniques perform equivalence preserving program and query transformations.

## Claims

### Claim 1

Method for optimizing the performance of database/web-service backed applications by automatically prefetching query results, said method comprising:
inserting, using at least one processor, prefetch instructions into an original program at the earliest possible point across procedure calls;
defining notion of query anticipability by extending anticipable expression analysis to query executions and web service invocations;
defining notions of data and control dependence bathers, wherein said notions are used to identify to invalidate query anticipability; and
using results of said query anticipability analysis and combining them with control flow and data flow information of said original program to arrive at the earliest point where said prefetch instructions are safely inserted to generate a transformed program;
wherein said prefetch instructions are moved across methods by combining said query anticipability analysis of individual methods; and
wherein said transformed program preserves equivalence with the original program.

### Claim 2 (depends on 1)

The method of claim 1, wherein said anticipable expression analysis facilitates expression motions by advancing computation of an expression to earlier points in a control flow graph (CFG).

### Claim 3 (depends on 2)

The method of claim 2, further comprising using said anticipable expression analysis for eliminating redundant computations of expressions.

### Claim 4 (depends on 2)

The method of claim 2 wherein said CFG includes a plurality of nodes.

### Claim 5 (depends on 2)

The method of claim 2, wherein said CFG has call graph to represent calling relationships between methods in a program.

### Claim 6 (depends on 2)

The method of claim 2, wherein at each node of said CFG, data is analyzed by data flow analysis technique; and sets Genn, Killn, Inn and Outn depend upon said flow analysis.

### Claim 7 (depends on 6)

The method of claim 6, further comprising using said data flow analyze technique with data barriers to prevent the prefetch instructions to be inserted before a control barrier.

### Claim 8 (depends on 1)

The method of claim 1, wherein said control dependence barriers prevent the prefetch instructions from being moved earlier.

### Claim 9 (depends on 1)

The method of claim of claim 1, wherein said control dependence barriers are followed by transitive code motion to increase the length of execution paths between two given program statements.

### Claim 10 (depends on 1)

The method of claim 1, wherein a prefetch instruction is inserted at a point only if the query is executed with the same parameter bindings subsequently wherein a prefetch request is not wasted.

### Claim 11 (depends on 1)

The method of claim 1, wherein said prefetch instructions are chained together.

### Claim 12 (depends on 1)

The method of claim 1, wherein said prefetch instructions are merged together.

### Claim 13 (depends on 1)

The method of claim 1, wherein all existing statements of the original program remain unchanged.

### Claim 14

A system for optimizing the performance of database/web-service backed applications, the system comprising:
a runtime library and a source-to-source program transformer module configured to:
insert prefetch instructions into a program at the earliest possible point across procedure calls;
define notion of query anticipability by extending anticipable expression analysis to query executions and web service invocations;
define notions of data and control dependence barriers, wherein said notions are used to identify to invalidate query anticipability; and
use results of said query anticipability analysis and combine them with control flow and data flow information of said program to arrive at the earliest point where said prefetch instructions are safely inserted;
wherein said prefetch instructions are moved across methods by combining said query anticipability analysis of individual methods; and
wherein said system uses any language and data API.
